1#![doc = "MAVLink cubepilot dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[cfg(feature = "ts")]
21use ts_rs::TS;
22pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
23#[cfg_attr(feature = "ts", derive(TS))]
24#[cfg_attr(feature = "ts", ts(export))]
25#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
26#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27#[cfg_attr(feature = "serde", serde(tag = "type"))]
28#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29#[repr(u32)]
30#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
31pub enum ActuatorConfiguration {
32 #[doc = "Do nothing."]
33 ACTUATOR_CONFIGURATION_NONE = 0,
34 #[doc = "Command the actuator to beep now."]
35 ACTUATOR_CONFIGURATION_BEEP = 1,
36 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
37 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
38 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
40 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
41 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
44}
45impl ActuatorConfiguration {
46 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
47}
48impl Default for ActuatorConfiguration {
49 fn default() -> Self {
50 Self::DEFAULT
51 }
52}
53#[cfg_attr(feature = "ts", derive(TS))]
54#[cfg_attr(feature = "ts", ts(export))]
55#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
56#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
57#[cfg_attr(feature = "serde", serde(tag = "type"))]
58#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
59#[repr(u32)]
60#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
61pub enum ActuatorOutputFunction {
62 #[doc = "No function (disabled)."]
63 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
64 #[doc = "Motor 1"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
66 #[doc = "Motor 2"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
68 #[doc = "Motor 3"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
70 #[doc = "Motor 4"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
72 #[doc = "Motor 5"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
74 #[doc = "Motor 6"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
76 #[doc = "Motor 7"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
78 #[doc = "Motor 8"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
80 #[doc = "Motor 9"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
82 #[doc = "Motor 10"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
84 #[doc = "Motor 11"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
86 #[doc = "Motor 12"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
88 #[doc = "Motor 13"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
90 #[doc = "Motor 14"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
92 #[doc = "Motor 15"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
94 #[doc = "Motor 16"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
96 #[doc = "Servo 1"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
98 #[doc = "Servo 2"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
100 #[doc = "Servo 3"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
102 #[doc = "Servo 4"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
104 #[doc = "Servo 5"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
106 #[doc = "Servo 6"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
108 #[doc = "Servo 7"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
110 #[doc = "Servo 8"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
112 #[doc = "Servo 9"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
114 #[doc = "Servo 10"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
116 #[doc = "Servo 11"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
118 #[doc = "Servo 12"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
120 #[doc = "Servo 13"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
122 #[doc = "Servo 14"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
124 #[doc = "Servo 15"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
126 #[doc = "Servo 16"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
128}
129impl ActuatorOutputFunction {
130 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
131}
132impl Default for ActuatorOutputFunction {
133 fn default() -> Self {
134 Self::DEFAULT
135 }
136}
137#[cfg_attr(feature = "ts", derive(TS))]
138#[cfg_attr(feature = "ts", ts(export))]
139#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
141#[cfg_attr(feature = "serde", serde(tag = "type"))]
142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
143#[repr(u32)]
144#[doc = "Enumeration of the ADSB altimeter types"]
145pub enum AdsbAltitudeType {
146 #[doc = "Altitude reported from a Baro source using QNH reference"]
147 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
148 #[doc = "Altitude reported from a GNSS source"]
149 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
150}
151impl AdsbAltitudeType {
152 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
153}
154impl Default for AdsbAltitudeType {
155 fn default() -> Self {
156 Self::DEFAULT
157 }
158}
159#[cfg_attr(feature = "ts", derive(TS))]
160#[cfg_attr(feature = "ts", ts(export))]
161#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
163#[cfg_attr(feature = "serde", serde(tag = "type"))]
164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
165#[repr(u32)]
166#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
167pub enum AdsbEmitterType {
168 ADSB_EMITTER_TYPE_NO_INFO = 0,
169 ADSB_EMITTER_TYPE_LIGHT = 1,
170 ADSB_EMITTER_TYPE_SMALL = 2,
171 ADSB_EMITTER_TYPE_LARGE = 3,
172 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
173 ADSB_EMITTER_TYPE_HEAVY = 5,
174 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
175 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
176 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
177 ADSB_EMITTER_TYPE_GLIDER = 9,
178 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
179 ADSB_EMITTER_TYPE_PARACHUTE = 11,
180 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
181 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
182 ADSB_EMITTER_TYPE_UAV = 14,
183 ADSB_EMITTER_TYPE_SPACE = 15,
184 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
185 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
186 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
187 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
188}
189impl AdsbEmitterType {
190 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
191}
192impl Default for AdsbEmitterType {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
198impl AdsbFlags {
199 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
200}
201impl Default for AdsbFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
207impl AisFlags {
208 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
209}
210impl Default for AisFlags {
211 fn default() -> Self {
212 Self::DEFAULT
213 }
214}
215#[cfg_attr(feature = "ts", derive(TS))]
216#[cfg_attr(feature = "ts", ts(export))]
217#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
219#[cfg_attr(feature = "serde", serde(tag = "type"))]
220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
221#[repr(u32)]
222#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
223pub enum AisNavStatus {
224 #[doc = "Under way using engine."]
225 UNDER_WAY = 0,
226 AIS_NAV_ANCHORED = 1,
227 AIS_NAV_UN_COMMANDED = 2,
228 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
229 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
230 AIS_NAV_MOORED = 5,
231 AIS_NAV_AGROUND = 6,
232 AIS_NAV_FISHING = 7,
233 AIS_NAV_SAILING = 8,
234 AIS_NAV_RESERVED_HSC = 9,
235 AIS_NAV_RESERVED_WIG = 10,
236 AIS_NAV_RESERVED_1 = 11,
237 AIS_NAV_RESERVED_2 = 12,
238 AIS_NAV_RESERVED_3 = 13,
239 #[doc = "Search And Rescue Transponder."]
240 AIS_NAV_AIS_SART = 14,
241 #[doc = "Not available (default)."]
242 AIS_NAV_UNKNOWN = 15,
243}
244impl AisNavStatus {
245 pub const DEFAULT: Self = Self::UNDER_WAY;
246}
247impl Default for AisNavStatus {
248 fn default() -> Self {
249 Self::DEFAULT
250 }
251}
252#[cfg_attr(feature = "ts", derive(TS))]
253#[cfg_attr(feature = "ts", ts(export))]
254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
256#[cfg_attr(feature = "serde", serde(tag = "type"))]
257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
258#[repr(u32)]
259#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
260pub enum AisType {
261 #[doc = "Not available (default)."]
262 AIS_TYPE_UNKNOWN = 0,
263 AIS_TYPE_RESERVED_1 = 1,
264 AIS_TYPE_RESERVED_2 = 2,
265 AIS_TYPE_RESERVED_3 = 3,
266 AIS_TYPE_RESERVED_4 = 4,
267 AIS_TYPE_RESERVED_5 = 5,
268 AIS_TYPE_RESERVED_6 = 6,
269 AIS_TYPE_RESERVED_7 = 7,
270 AIS_TYPE_RESERVED_8 = 8,
271 AIS_TYPE_RESERVED_9 = 9,
272 AIS_TYPE_RESERVED_10 = 10,
273 AIS_TYPE_RESERVED_11 = 11,
274 AIS_TYPE_RESERVED_12 = 12,
275 AIS_TYPE_RESERVED_13 = 13,
276 AIS_TYPE_RESERVED_14 = 14,
277 AIS_TYPE_RESERVED_15 = 15,
278 AIS_TYPE_RESERVED_16 = 16,
279 AIS_TYPE_RESERVED_17 = 17,
280 AIS_TYPE_RESERVED_18 = 18,
281 AIS_TYPE_RESERVED_19 = 19,
282 #[doc = "Wing In Ground effect."]
283 AIS_TYPE_WIG = 20,
284 AIS_TYPE_WIG_HAZARDOUS_A = 21,
285 AIS_TYPE_WIG_HAZARDOUS_B = 22,
286 AIS_TYPE_WIG_HAZARDOUS_C = 23,
287 AIS_TYPE_WIG_HAZARDOUS_D = 24,
288 AIS_TYPE_WIG_RESERVED_1 = 25,
289 AIS_TYPE_WIG_RESERVED_2 = 26,
290 AIS_TYPE_WIG_RESERVED_3 = 27,
291 AIS_TYPE_WIG_RESERVED_4 = 28,
292 AIS_TYPE_WIG_RESERVED_5 = 29,
293 AIS_TYPE_FISHING = 30,
294 AIS_TYPE_TOWING = 31,
295 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
296 AIS_TYPE_TOWING_LARGE = 32,
297 #[doc = "Dredging or other underwater ops."]
298 AIS_TYPE_DREDGING = 33,
299 AIS_TYPE_DIVING = 34,
300 AIS_TYPE_MILITARY = 35,
301 AIS_TYPE_SAILING = 36,
302 AIS_TYPE_PLEASURE = 37,
303 AIS_TYPE_RESERVED_20 = 38,
304 AIS_TYPE_RESERVED_21 = 39,
305 #[doc = "High Speed Craft."]
306 AIS_TYPE_HSC = 40,
307 AIS_TYPE_HSC_HAZARDOUS_A = 41,
308 AIS_TYPE_HSC_HAZARDOUS_B = 42,
309 AIS_TYPE_HSC_HAZARDOUS_C = 43,
310 AIS_TYPE_HSC_HAZARDOUS_D = 44,
311 AIS_TYPE_HSC_RESERVED_1 = 45,
312 AIS_TYPE_HSC_RESERVED_2 = 46,
313 AIS_TYPE_HSC_RESERVED_3 = 47,
314 AIS_TYPE_HSC_RESERVED_4 = 48,
315 AIS_TYPE_HSC_UNKNOWN = 49,
316 AIS_TYPE_PILOT = 50,
317 #[doc = "Search And Rescue vessel."]
318 AIS_TYPE_SAR = 51,
319 AIS_TYPE_TUG = 52,
320 AIS_TYPE_PORT_TENDER = 53,
321 #[doc = "Anti-pollution equipment."]
322 AIS_TYPE_ANTI_POLLUTION = 54,
323 AIS_TYPE_LAW_ENFORCEMENT = 55,
324 AIS_TYPE_SPARE_LOCAL_1 = 56,
325 AIS_TYPE_SPARE_LOCAL_2 = 57,
326 AIS_TYPE_MEDICAL_TRANSPORT = 58,
327 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
328 AIS_TYPE_NONECOMBATANT = 59,
329 AIS_TYPE_PASSENGER = 60,
330 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
331 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
332 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
333 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
334 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
335 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
336 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
337 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
338 AIS_TYPE_PASSENGER_UNKNOWN = 69,
339 AIS_TYPE_CARGO = 70,
340 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
341 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
342 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
343 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
344 AIS_TYPE_CARGO_RESERVED_1 = 75,
345 AIS_TYPE_CARGO_RESERVED_2 = 76,
346 AIS_TYPE_CARGO_RESERVED_3 = 77,
347 AIS_TYPE_CARGO_RESERVED_4 = 78,
348 AIS_TYPE_CARGO_UNKNOWN = 79,
349 AIS_TYPE_TANKER = 80,
350 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
351 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
352 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
353 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
354 AIS_TYPE_TANKER_RESERVED_1 = 85,
355 AIS_TYPE_TANKER_RESERVED_2 = 86,
356 AIS_TYPE_TANKER_RESERVED_3 = 87,
357 AIS_TYPE_TANKER_RESERVED_4 = 88,
358 AIS_TYPE_TANKER_UNKNOWN = 89,
359 AIS_TYPE_OTHER = 90,
360 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
361 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
362 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
363 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
364 AIS_TYPE_OTHER_RESERVED_1 = 95,
365 AIS_TYPE_OTHER_RESERVED_2 = 96,
366 AIS_TYPE_OTHER_RESERVED_3 = 97,
367 AIS_TYPE_OTHER_RESERVED_4 = 98,
368 AIS_TYPE_OTHER_UNKNOWN = 99,
369}
370impl AisType {
371 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
372}
373impl Default for AisType {
374 fn default() -> Self {
375 Self::DEFAULT
376 }
377}
378bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
379impl AttitudeTargetTypemask {
380 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
381}
382impl Default for AttitudeTargetTypemask {
383 fn default() -> Self {
384 Self::DEFAULT
385 }
386}
387#[cfg_attr(feature = "ts", derive(TS))]
388#[cfg_attr(feature = "ts", ts(export))]
389#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
391#[cfg_attr(feature = "serde", serde(tag = "type"))]
392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
393#[repr(u32)]
394#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
395pub enum AutotuneAxis {
396 #[doc = "Autotune roll axis."]
397 AUTOTUNE_AXIS_ROLL = 1,
398 #[doc = "Autotune pitch axis."]
399 AUTOTUNE_AXIS_PITCH = 2,
400 #[doc = "Autotune yaw axis."]
401 AUTOTUNE_AXIS_YAW = 4,
402}
403impl AutotuneAxis {
404 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
405}
406impl Default for AutotuneAxis {
407 fn default() -> Self {
408 Self::DEFAULT
409 }
410}
411bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
412impl CameraCapFlags {
413 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
414}
415impl Default for CameraCapFlags {
416 fn default() -> Self {
417 Self::DEFAULT
418 }
419}
420#[cfg_attr(feature = "ts", derive(TS))]
421#[cfg_attr(feature = "ts", ts(export))]
422#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
424#[cfg_attr(feature = "serde", serde(tag = "type"))]
425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
426#[repr(u32)]
427#[doc = "Camera Modes."]
428pub enum CameraMode {
429 #[doc = "Camera is in image/photo capture mode."]
430 CAMERA_MODE_IMAGE = 0,
431 #[doc = "Camera is in video capture mode."]
432 CAMERA_MODE_VIDEO = 1,
433 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
434 CAMERA_MODE_IMAGE_SURVEY = 2,
435}
436impl CameraMode {
437 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
438}
439impl Default for CameraMode {
440 fn default() -> Self {
441 Self::DEFAULT
442 }
443}
444#[cfg_attr(feature = "ts", derive(TS))]
445#[cfg_attr(feature = "ts", ts(export))]
446#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
448#[cfg_attr(feature = "serde", serde(tag = "type"))]
449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
450#[repr(u32)]
451#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
452pub enum CameraSource {
453 #[doc = "Default camera source."]
454 CAMERA_SOURCE_DEFAULT = 0,
455 #[doc = "RGB camera source."]
456 CAMERA_SOURCE_RGB = 1,
457 #[doc = "IR camera source."]
458 CAMERA_SOURCE_IR = 2,
459 #[doc = "NDVI camera source."]
460 CAMERA_SOURCE_NDVI = 3,
461}
462impl CameraSource {
463 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
464}
465impl Default for CameraSource {
466 fn default() -> Self {
467 Self::DEFAULT
468 }
469}
470#[cfg_attr(feature = "ts", derive(TS))]
471#[cfg_attr(feature = "ts", ts(export))]
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking modes"]
478pub enum CameraTrackingMode {
479 #[doc = "Not tracking"]
480 CAMERA_TRACKING_MODE_NONE = 0,
481 #[doc = "Target is a point"]
482 CAMERA_TRACKING_MODE_POINT = 1,
483 #[doc = "Target is a rectangle"]
484 CAMERA_TRACKING_MODE_RECTANGLE = 2,
485}
486impl CameraTrackingMode {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
488}
489impl Default for CameraTrackingMode {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494#[cfg_attr(feature = "ts", derive(TS))]
495#[cfg_attr(feature = "ts", ts(export))]
496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
498#[cfg_attr(feature = "serde", serde(tag = "type"))]
499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
500#[repr(u32)]
501#[doc = "Camera tracking status flags"]
502pub enum CameraTrackingStatusFlags {
503 #[doc = "Camera is not tracking"]
504 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
505 #[doc = "Camera is tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
507 #[doc = "Camera tracking in error state"]
508 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
509}
510impl CameraTrackingStatusFlags {
511 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
512}
513impl Default for CameraTrackingStatusFlags {
514 fn default() -> Self {
515 Self::DEFAULT
516 }
517}
518bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
519impl CameraTrackingTargetData {
520 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
521}
522impl Default for CameraTrackingTargetData {
523 fn default() -> Self {
524 Self::DEFAULT
525 }
526}
527#[cfg_attr(feature = "ts", derive(TS))]
528#[cfg_attr(feature = "ts", ts(export))]
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
535pub enum CameraZoomType {
536 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
537 ZOOM_TYPE_STEP = 0,
538 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
539 ZOOM_TYPE_CONTINUOUS = 1,
540 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
541 ZOOM_TYPE_RANGE = 2,
542 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
543 ZOOM_TYPE_FOCAL_LENGTH = 3,
544 #[doc = "Zoom value as horizontal field of view in degrees."]
545 ZOOM_TYPE_HORIZONTAL_FOV = 4,
546}
547impl CameraZoomType {
548 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
549}
550impl Default for CameraZoomType {
551 fn default() -> Self {
552 Self::DEFAULT
553 }
554}
555#[cfg_attr(feature = "ts", derive(TS))]
556#[cfg_attr(feature = "ts", ts(export))]
557#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
559#[cfg_attr(feature = "serde", serde(tag = "type"))]
560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
561#[repr(u32)]
562pub enum CanFilterOp {
563 CAN_FILTER_REPLACE = 0,
564 CAN_FILTER_ADD = 1,
565 CAN_FILTER_REMOVE = 2,
566}
567impl CanFilterOp {
568 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
569}
570impl Default for CanFilterOp {
571 fn default() -> Self {
572 Self::DEFAULT
573 }
574}
575#[cfg_attr(feature = "ts", derive(TS))]
576#[cfg_attr(feature = "ts", ts(export))]
577#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
579#[cfg_attr(feature = "serde", serde(tag = "type"))]
580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
581#[repr(u32)]
582#[doc = "Possible responses from a CELLULAR_CONFIG message."]
583pub enum CellularConfigResponse {
584 #[doc = "Changes accepted."]
585 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
586 #[doc = "Invalid APN."]
587 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
588 #[doc = "Invalid PIN."]
589 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
590 #[doc = "Changes rejected."]
591 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
592 #[doc = "PUK is required to unblock SIM card."]
593 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
594}
595impl CellularConfigResponse {
596 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
597}
598impl Default for CellularConfigResponse {
599 fn default() -> Self {
600 Self::DEFAULT
601 }
602}
603#[cfg_attr(feature = "ts", derive(TS))]
604#[cfg_attr(feature = "ts", ts(export))]
605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
607#[cfg_attr(feature = "serde", serde(tag = "type"))]
608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
609#[repr(u32)]
610#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
611pub enum CellularNetworkFailedReason {
612 #[doc = "No error"]
613 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
614 #[doc = "Error state is unknown"]
615 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
616 #[doc = "SIM is required for the modem but missing"]
617 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
618 #[doc = "SIM is available, but not usable for connection"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
620}
621impl CellularNetworkFailedReason {
622 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
623}
624impl Default for CellularNetworkFailedReason {
625 fn default() -> Self {
626 Self::DEFAULT
627 }
628}
629#[cfg_attr(feature = "ts", derive(TS))]
630#[cfg_attr(feature = "ts", ts(export))]
631#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
633#[cfg_attr(feature = "serde", serde(tag = "type"))]
634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
635#[repr(u32)]
636#[doc = "Cellular network radio type"]
637pub enum CellularNetworkRadioType {
638 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
639 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
640 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
641 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
642 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
643}
644impl CellularNetworkRadioType {
645 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
646}
647impl Default for CellularNetworkRadioType {
648 fn default() -> Self {
649 Self::DEFAULT
650 }
651}
652#[cfg_attr(feature = "ts", derive(TS))]
653#[cfg_attr(feature = "ts", ts(export))]
654#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
656#[cfg_attr(feature = "serde", serde(tag = "type"))]
657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
658#[repr(u32)]
659#[doc = "These flags encode the cellular network status"]
660pub enum CellularStatusFlag {
661 #[doc = "State unknown or not reportable."]
662 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
663 #[doc = "Modem is unusable"]
664 CELLULAR_STATUS_FLAG_FAILED = 1,
665 #[doc = "Modem is being initialized"]
666 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
667 #[doc = "Modem is locked"]
668 CELLULAR_STATUS_FLAG_LOCKED = 3,
669 #[doc = "Modem is not enabled and is powered down"]
670 CELLULAR_STATUS_FLAG_DISABLED = 4,
671 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
672 CELLULAR_STATUS_FLAG_DISABLING = 5,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
674 CELLULAR_STATUS_FLAG_ENABLING = 6,
675 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
676 CELLULAR_STATUS_FLAG_ENABLED = 7,
677 #[doc = "Modem is searching for a network provider to register"]
678 CELLULAR_STATUS_FLAG_SEARCHING = 8,
679 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
680 CELLULAR_STATUS_FLAG_REGISTERED = 9,
681 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
682 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
683 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
684 CELLULAR_STATUS_FLAG_CONNECTING = 11,
685 #[doc = "One or more packet data bearers is active and connected"]
686 CELLULAR_STATUS_FLAG_CONNECTED = 12,
687}
688impl CellularStatusFlag {
689 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
690}
691impl Default for CellularStatusFlag {
692 fn default() -> Self {
693 Self::DEFAULT
694 }
695}
696#[cfg_attr(feature = "ts", derive(TS))]
697#[cfg_attr(feature = "ts", ts(export))]
698#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
700#[cfg_attr(feature = "serde", serde(tag = "type"))]
701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
702#[repr(u32)]
703#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
704pub enum CompMetadataType {
705 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
706 COMP_METADATA_TYPE_GENERAL = 0,
707 #[doc = "Parameter meta data."]
708 COMP_METADATA_TYPE_PARAMETER = 1,
709 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
710 COMP_METADATA_TYPE_COMMANDS = 2,
711 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
712 COMP_METADATA_TYPE_PERIPHERALS = 3,
713 #[doc = "Meta data for the events interface."]
714 COMP_METADATA_TYPE_EVENTS = 4,
715 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
716 COMP_METADATA_TYPE_ACTUATORS = 5,
717}
718impl CompMetadataType {
719 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
720}
721impl Default for CompMetadataType {
722 fn default() -> Self {
723 Self::DEFAULT
724 }
725}
726#[cfg_attr(feature = "ts", derive(TS))]
727#[cfg_attr(feature = "ts", ts(export))]
728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
730#[cfg_attr(feature = "serde", serde(tag = "type"))]
731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
732#[repr(u32)]
733#[doc = "Indicates the ESC connection type."]
734pub enum EscConnectionType {
735 #[doc = "Traditional PPM ESC."]
736 ESC_CONNECTION_TYPE_PPM = 0,
737 #[doc = "Serial Bus connected ESC."]
738 ESC_CONNECTION_TYPE_SERIAL = 1,
739 #[doc = "One Shot PPM ESC."]
740 ESC_CONNECTION_TYPE_ONESHOT = 2,
741 #[doc = "I2C ESC."]
742 ESC_CONNECTION_TYPE_I2C = 3,
743 #[doc = "CAN-Bus ESC."]
744 ESC_CONNECTION_TYPE_CAN = 4,
745 #[doc = "DShot ESC."]
746 ESC_CONNECTION_TYPE_DSHOT = 5,
747}
748impl EscConnectionType {
749 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
750}
751impl Default for EscConnectionType {
752 fn default() -> Self {
753 Self::DEFAULT
754 }
755}
756bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
757impl EscFailureFlags {
758 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
759}
760impl Default for EscFailureFlags {
761 fn default() -> Self {
762 Self::DEFAULT
763 }
764}
765bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
766impl EstimatorStatusFlags {
767 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
768}
769impl Default for EstimatorStatusFlags {
770 fn default() -> Self {
771 Self::DEFAULT
772 }
773}
774#[cfg_attr(feature = "ts", derive(TS))]
775#[cfg_attr(feature = "ts", ts(export))]
776#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
778#[cfg_attr(feature = "serde", serde(tag = "type"))]
779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
780#[repr(u32)]
781#[doc = "List of possible failure type to inject."]
782pub enum FailureType {
783 #[doc = "No failure injected, used to reset a previous failure."]
784 FAILURE_TYPE_OK = 0,
785 #[doc = "Sets unit off, so completely non-responsive."]
786 FAILURE_TYPE_OFF = 1,
787 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
788 FAILURE_TYPE_STUCK = 2,
789 #[doc = "Unit is reporting complete garbage."]
790 FAILURE_TYPE_GARBAGE = 3,
791 #[doc = "Unit is consistently wrong."]
792 FAILURE_TYPE_WRONG = 4,
793 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
794 FAILURE_TYPE_SLOW = 5,
795 #[doc = "Data of unit is delayed in time."]
796 FAILURE_TYPE_DELAYED = 6,
797 #[doc = "Unit is sometimes working, sometimes not."]
798 FAILURE_TYPE_INTERMITTENT = 7,
799}
800impl FailureType {
801 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
802}
803impl Default for FailureType {
804 fn default() -> Self {
805 Self::DEFAULT
806 }
807}
808#[cfg_attr(feature = "ts", derive(TS))]
809#[cfg_attr(feature = "ts", ts(export))]
810#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
812#[cfg_attr(feature = "serde", serde(tag = "type"))]
813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
814#[repr(u32)]
815#[doc = "List of possible units where failures can be injected."]
816pub enum FailureUnit {
817 FAILURE_UNIT_SENSOR_GYRO = 0,
818 FAILURE_UNIT_SENSOR_ACCEL = 1,
819 FAILURE_UNIT_SENSOR_MAG = 2,
820 FAILURE_UNIT_SENSOR_BARO = 3,
821 FAILURE_UNIT_SENSOR_GPS = 4,
822 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
823 FAILURE_UNIT_SENSOR_VIO = 6,
824 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
825 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
826 FAILURE_UNIT_SYSTEM_BATTERY = 100,
827 FAILURE_UNIT_SYSTEM_MOTOR = 101,
828 FAILURE_UNIT_SYSTEM_SERVO = 102,
829 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
830 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
831 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
832}
833impl FailureUnit {
834 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
835}
836impl Default for FailureUnit {
837 fn default() -> Self {
838 Self::DEFAULT
839 }
840}
841#[cfg_attr(feature = "ts", derive(TS))]
842#[cfg_attr(feature = "ts", ts(export))]
843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
845#[cfg_attr(feature = "serde", serde(tag = "type"))]
846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
847#[repr(u32)]
848pub enum FenceBreach {
849 #[doc = "No last fence breach"]
850 FENCE_BREACH_NONE = 0,
851 #[doc = "Breached minimum altitude"]
852 FENCE_BREACH_MINALT = 1,
853 #[doc = "Breached maximum altitude"]
854 FENCE_BREACH_MAXALT = 2,
855 #[doc = "Breached fence boundary"]
856 FENCE_BREACH_BOUNDARY = 3,
857}
858impl FenceBreach {
859 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
860}
861impl Default for FenceBreach {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[cfg_attr(feature = "ts", derive(TS))]
867#[cfg_attr(feature = "ts", ts(export))]
868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
870#[cfg_attr(feature = "serde", serde(tag = "type"))]
871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
872#[repr(u32)]
873#[doc = "Actions being taken to mitigate/prevent fence breach"]
874pub enum FenceMitigate {
875 #[doc = "Unknown"]
876 FENCE_MITIGATE_UNKNOWN = 0,
877 #[doc = "No actions being taken"]
878 FENCE_MITIGATE_NONE = 1,
879 #[doc = "Velocity limiting active to prevent breach"]
880 FENCE_MITIGATE_VEL_LIMIT = 2,
881}
882impl FenceMitigate {
883 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
884}
885impl Default for FenceMitigate {
886 fn default() -> Self {
887 Self::DEFAULT
888 }
889}
890#[cfg_attr(feature = "ts", derive(TS))]
891#[cfg_attr(feature = "ts", ts(export))]
892#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
894#[cfg_attr(feature = "serde", serde(tag = "type"))]
895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
896#[repr(u32)]
897#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
898pub enum FenceType {
899 #[doc = "Maximum altitude fence"]
900 FENCE_TYPE_ALT_MAX = 1,
901 #[doc = "Circle fence"]
902 FENCE_TYPE_CIRCLE = 2,
903 #[doc = "Polygon fence"]
904 FENCE_TYPE_POLYGON = 4,
905 #[doc = "Minimum altitude fence"]
906 FENCE_TYPE_ALT_MIN = 8,
907}
908impl FenceType {
909 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
910}
911impl Default for FenceType {
912 fn default() -> Self {
913 Self::DEFAULT
914 }
915}
916#[cfg_attr(feature = "ts", derive(TS))]
917#[cfg_attr(feature = "ts", ts(export))]
918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
920#[cfg_attr(feature = "serde", serde(tag = "type"))]
921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
922#[repr(u32)]
923#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
924pub enum FirmwareVersionType {
925 #[doc = "development release"]
926 FIRMWARE_VERSION_TYPE_DEV = 0,
927 #[doc = "alpha release"]
928 FIRMWARE_VERSION_TYPE_ALPHA = 64,
929 #[doc = "beta release"]
930 FIRMWARE_VERSION_TYPE_BETA = 128,
931 #[doc = "release candidate"]
932 FIRMWARE_VERSION_TYPE_RC = 192,
933 #[doc = "official stable release"]
934 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
935}
936impl FirmwareVersionType {
937 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
938}
939impl Default for FirmwareVersionType {
940 fn default() -> Self {
941 Self::DEFAULT
942 }
943}
944bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
945impl GimbalDeviceCapFlags {
946 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
947}
948impl Default for GimbalDeviceCapFlags {
949 fn default() -> Self {
950 Self::DEFAULT
951 }
952}
953bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
954impl GimbalDeviceErrorFlags {
955 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
956}
957impl Default for GimbalDeviceErrorFlags {
958 fn default() -> Self {
959 Self::DEFAULT
960 }
961}
962bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
963impl GimbalDeviceFlags {
964 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
965}
966impl Default for GimbalDeviceFlags {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
972impl GimbalManagerCapFlags {
973 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
974}
975impl Default for GimbalManagerCapFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
981impl GimbalManagerFlags {
982 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
983}
984impl Default for GimbalManagerFlags {
985 fn default() -> Self {
986 Self::DEFAULT
987 }
988}
989#[cfg_attr(feature = "ts", derive(TS))]
990#[cfg_attr(feature = "ts", ts(export))]
991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
993#[cfg_attr(feature = "serde", serde(tag = "type"))]
994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
995#[repr(u32)]
996#[doc = "Type of GPS fix"]
997pub enum GpsFixType {
998 #[doc = "No GPS connected"]
999 GPS_FIX_TYPE_NO_GPS = 0,
1000 #[doc = "No position information, GPS is connected"]
1001 GPS_FIX_TYPE_NO_FIX = 1,
1002 #[doc = "2D position"]
1003 GPS_FIX_TYPE_2D_FIX = 2,
1004 #[doc = "3D position"]
1005 GPS_FIX_TYPE_3D_FIX = 3,
1006 #[doc = "DGPS/SBAS aided 3D position"]
1007 GPS_FIX_TYPE_DGPS = 4,
1008 #[doc = "RTK float, 3D position"]
1009 GPS_FIX_TYPE_RTK_FLOAT = 5,
1010 #[doc = "RTK Fixed, 3D position"]
1011 GPS_FIX_TYPE_RTK_FIXED = 6,
1012 #[doc = "Static fixed, typically used for base stations"]
1013 GPS_FIX_TYPE_STATIC = 7,
1014 #[doc = "PPP, 3D position."]
1015 GPS_FIX_TYPE_PPP = 8,
1016}
1017impl GpsFixType {
1018 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1019}
1020impl Default for GpsFixType {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1026impl GpsInputIgnoreFlags {
1027 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1028}
1029impl Default for GpsInputIgnoreFlags {
1030 fn default() -> Self {
1031 Self::DEFAULT
1032 }
1033}
1034#[cfg_attr(feature = "ts", derive(TS))]
1035#[cfg_attr(feature = "ts", ts(export))]
1036#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1038#[cfg_attr(feature = "serde", serde(tag = "type"))]
1039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1040#[repr(u32)]
1041#[doc = "Gripper actions."]
1042pub enum GripperActions {
1043 #[doc = "Gripper release cargo."]
1044 GRIPPER_ACTION_RELEASE = 0,
1045 #[doc = "Gripper grab onto cargo."]
1046 GRIPPER_ACTION_GRAB = 1,
1047}
1048impl GripperActions {
1049 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1050}
1051impl Default for GripperActions {
1052 fn default() -> Self {
1053 Self::DEFAULT
1054 }
1055}
1056bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1057impl HighresImuUpdatedFlags {
1058 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1059}
1060impl Default for HighresImuUpdatedFlags {
1061 fn default() -> Self {
1062 Self::DEFAULT
1063 }
1064}
1065bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1066impl HilActuatorControlsFlags {
1067 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1068}
1069impl Default for HilActuatorControlsFlags {
1070 fn default() -> Self {
1071 Self::DEFAULT
1072 }
1073}
1074bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1075impl HilSensorUpdatedFlags {
1076 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1077}
1078impl Default for HilSensorUpdatedFlags {
1079 fn default() -> Self {
1080 Self::DEFAULT
1081 }
1082}
1083bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1084impl HlFailureFlag {
1085 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1086}
1087impl Default for HlFailureFlag {
1088 fn default() -> Self {
1089 Self::DEFAULT
1090 }
1091}
1092bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1093impl IlluminatorErrorFlags {
1094 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1095}
1096impl Default for IlluminatorErrorFlags {
1097 fn default() -> Self {
1098 Self::DEFAULT
1099 }
1100}
1101#[cfg_attr(feature = "ts", derive(TS))]
1102#[cfg_attr(feature = "ts", ts(export))]
1103#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1105#[cfg_attr(feature = "serde", serde(tag = "type"))]
1106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1107#[repr(u32)]
1108#[doc = "Modes of illuminator"]
1109pub enum IlluminatorMode {
1110 #[doc = "Illuminator mode is not specified/unknown"]
1111 ILLUMINATOR_MODE_UNKNOWN = 0,
1112 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1113 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1114 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1115 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1116}
1117impl IlluminatorMode {
1118 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1119}
1120impl Default for IlluminatorMode {
1121 fn default() -> Self {
1122 Self::DEFAULT
1123 }
1124}
1125#[cfg_attr(feature = "ts", derive(TS))]
1126#[cfg_attr(feature = "ts", ts(export))]
1127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1129#[cfg_attr(feature = "serde", serde(tag = "type"))]
1130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1131#[repr(u32)]
1132#[doc = "Type of landing target"]
1133pub enum LandingTargetType {
1134 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1135 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1136 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1137 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1138 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1139 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1140 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1141 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1142}
1143impl LandingTargetType {
1144 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1145}
1146impl Default for LandingTargetType {
1147 fn default() -> Self {
1148 Self::DEFAULT
1149 }
1150}
1151#[cfg_attr(feature = "ts", derive(TS))]
1152#[cfg_attr(feature = "ts", ts(export))]
1153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1155#[cfg_attr(feature = "serde", serde(tag = "type"))]
1156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1157#[repr(u32)]
1158pub enum MagCalStatus {
1159 MAG_CAL_NOT_STARTED = 0,
1160 MAG_CAL_WAITING_TO_START = 1,
1161 MAG_CAL_RUNNING_STEP_ONE = 2,
1162 MAG_CAL_RUNNING_STEP_TWO = 3,
1163 MAG_CAL_SUCCESS = 4,
1164 MAG_CAL_FAILED = 5,
1165 MAG_CAL_BAD_ORIENTATION = 6,
1166 MAG_CAL_BAD_RADIUS = 7,
1167}
1168impl MagCalStatus {
1169 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1170}
1171impl Default for MagCalStatus {
1172 fn default() -> Self {
1173 Self::DEFAULT
1174 }
1175}
1176#[cfg_attr(feature = "ts", derive(TS))]
1177#[cfg_attr(feature = "ts", ts(export))]
1178#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1180#[cfg_attr(feature = "serde", serde(tag = "type"))]
1181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1182#[repr(u32)]
1183pub enum MavArmAuthDeniedReason {
1184 #[doc = "Not a specific reason"]
1185 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1186 #[doc = "Authorizer will send the error as string to GCS"]
1187 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1188 #[doc = "At least one waypoint have a invalid value"]
1189 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1190 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1191 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1192 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1193 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1194 #[doc = "Weather is not good to fly"]
1195 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1196}
1197impl MavArmAuthDeniedReason {
1198 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1199}
1200impl Default for MavArmAuthDeniedReason {
1201 fn default() -> Self {
1202 Self::DEFAULT
1203 }
1204}
1205#[cfg_attr(feature = "ts", derive(TS))]
1206#[cfg_attr(feature = "ts", ts(export))]
1207#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1209#[cfg_attr(feature = "serde", serde(tag = "type"))]
1210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1211#[repr(u32)]
1212#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1213pub enum MavAutopilot {
1214 #[doc = "Generic autopilot, full support for everything"]
1215 MAV_AUTOPILOT_GENERIC = 0,
1216 #[doc = "Reserved for future use."]
1217 MAV_AUTOPILOT_RESERVED = 1,
1218 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1219 MAV_AUTOPILOT_SLUGS = 2,
1220 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1221 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1222 #[doc = "OpenPilot, <http://openpilot.org>"]
1223 MAV_AUTOPILOT_OPENPILOT = 4,
1224 #[doc = "Generic autopilot only supporting simple waypoints"]
1225 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1226 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1228 #[doc = "Generic autopilot supporting the full mission command set"]
1229 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1230 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1231 MAV_AUTOPILOT_INVALID = 8,
1232 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1233 MAV_AUTOPILOT_PPZ = 9,
1234 #[doc = "UAV Dev Board"]
1235 MAV_AUTOPILOT_UDB = 10,
1236 #[doc = "FlexiPilot"]
1237 MAV_AUTOPILOT_FP = 11,
1238 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1239 MAV_AUTOPILOT_PX4 = 12,
1240 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1241 MAV_AUTOPILOT_SMACCMPILOT = 13,
1242 #[doc = "AutoQuad -- <http://autoquad.org>"]
1243 MAV_AUTOPILOT_AUTOQUAD = 14,
1244 #[doc = "Armazila -- <http://armazila.com>"]
1245 MAV_AUTOPILOT_ARMAZILA = 15,
1246 #[doc = "Aerob -- <http://aerob.ru>"]
1247 MAV_AUTOPILOT_AEROB = 16,
1248 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1249 MAV_AUTOPILOT_ASLUAV = 17,
1250 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1251 MAV_AUTOPILOT_SMARTAP = 18,
1252 #[doc = "AirRails - <http://uaventure.com>"]
1253 MAV_AUTOPILOT_AIRRAILS = 19,
1254 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1255 MAV_AUTOPILOT_REFLEX = 20,
1256}
1257impl MavAutopilot {
1258 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1259}
1260impl Default for MavAutopilot {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[cfg_attr(feature = "ts", derive(TS))]
1266#[cfg_attr(feature = "ts", ts(export))]
1267#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1269#[cfg_attr(feature = "serde", serde(tag = "type"))]
1270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1271#[repr(u32)]
1272#[doc = "Enumeration for battery charge states."]
1273pub enum MavBatteryChargeState {
1274 #[doc = "Low battery state is not provided"]
1275 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1276 #[doc = "Battery is not in low state. Normal operation."]
1277 MAV_BATTERY_CHARGE_STATE_OK = 1,
1278 #[doc = "Battery state is low, warn and monitor close."]
1279 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1280 #[doc = "Battery state is critical, return or abort immediately."]
1281 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1282 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1283 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1284 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1285 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1286 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1288 #[doc = "Battery is charging."]
1289 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1290}
1291impl MavBatteryChargeState {
1292 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1293}
1294impl Default for MavBatteryChargeState {
1295 fn default() -> Self {
1296 Self::DEFAULT
1297 }
1298}
1299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1300impl MavBatteryFault {
1301 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1302}
1303impl Default for MavBatteryFault {
1304 fn default() -> Self {
1305 Self::DEFAULT
1306 }
1307}
1308#[cfg_attr(feature = "ts", derive(TS))]
1309#[cfg_attr(feature = "ts", ts(export))]
1310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1312#[cfg_attr(feature = "serde", serde(tag = "type"))]
1313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1314#[repr(u32)]
1315#[doc = "Enumeration of battery functions"]
1316pub enum MavBatteryFunction {
1317 #[doc = "Battery function is unknown"]
1318 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1319 #[doc = "Battery supports all flight systems"]
1320 MAV_BATTERY_FUNCTION_ALL = 1,
1321 #[doc = "Battery for the propulsion system"]
1322 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1323 #[doc = "Avionics battery"]
1324 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1325 #[doc = "Payload battery"]
1326 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1327}
1328impl MavBatteryFunction {
1329 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1330}
1331impl Default for MavBatteryFunction {
1332 fn default() -> Self {
1333 Self::DEFAULT
1334 }
1335}
1336#[cfg_attr(feature = "ts", derive(TS))]
1337#[cfg_attr(feature = "ts", ts(export))]
1338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1340#[cfg_attr(feature = "serde", serde(tag = "type"))]
1341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1342#[repr(u32)]
1343#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1344pub enum MavBatteryMode {
1345 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1346 MAV_BATTERY_MODE_UNKNOWN = 0,
1347 #[doc = "Battery is auto discharging (towards storage level)."]
1348 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1349 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1350 MAV_BATTERY_MODE_HOT_SWAP = 2,
1351}
1352impl MavBatteryMode {
1353 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1354}
1355impl Default for MavBatteryMode {
1356 fn default() -> Self {
1357 Self::DEFAULT
1358 }
1359}
1360#[cfg_attr(feature = "ts", derive(TS))]
1361#[cfg_attr(feature = "ts", ts(export))]
1362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1364#[cfg_attr(feature = "serde", serde(tag = "type"))]
1365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1366#[repr(u32)]
1367#[doc = "Enumeration of battery types"]
1368pub enum MavBatteryType {
1369 #[doc = "Not specified."]
1370 MAV_BATTERY_TYPE_UNKNOWN = 0,
1371 #[doc = "Lithium polymer battery"]
1372 MAV_BATTERY_TYPE_LIPO = 1,
1373 #[doc = "Lithium-iron-phosphate battery"]
1374 MAV_BATTERY_TYPE_LIFE = 2,
1375 #[doc = "Lithium-ION battery"]
1376 MAV_BATTERY_TYPE_LION = 3,
1377 #[doc = "Nickel metal hydride battery"]
1378 MAV_BATTERY_TYPE_NIMH = 4,
1379}
1380impl MavBatteryType {
1381 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1382}
1383impl Default for MavBatteryType {
1384 fn default() -> Self {
1385 Self::DEFAULT
1386 }
1387}
1388#[cfg_attr(feature = "ts", derive(TS))]
1389#[cfg_attr(feature = "ts", ts(export))]
1390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1392#[cfg_attr(feature = "serde", serde(tag = "type"))]
1393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1394#[repr(u32)]
1395#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1396pub enum MavCmd {
1397 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1398 MAV_CMD_NAV_WAYPOINT = 16,
1399 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1400 MAV_CMD_NAV_LOITER_UNLIM = 17,
1401 #[doc = "Loiter around this waypoint for X turns"]
1402 MAV_CMD_NAV_LOITER_TURNS = 18,
1403 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1404 MAV_CMD_NAV_LOITER_TIME = 19,
1405 #[doc = "Return to launch location"]
1406 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1407 #[doc = "Land at location."]
1408 MAV_CMD_NAV_LAND = 21,
1409 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1410 MAV_CMD_NAV_TAKEOFF = 22,
1411 #[doc = "Land at local position (local frame only)"]
1412 MAV_CMD_NAV_LAND_LOCAL = 23,
1413 #[doc = "Takeoff from local position (local frame only)"]
1414 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1415 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1416 MAV_CMD_NAV_FOLLOW = 25,
1417 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1418 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1419 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1420 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1421 #[doc = "Begin following a target"]
1422 MAV_CMD_DO_FOLLOW = 32,
1423 #[doc = "Reposition the MAV after a follow target command has been sent"]
1424 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1425 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1426 MAV_CMD_DO_ORBIT = 34,
1427 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1428 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1429 MAV_CMD_NAV_ROI = 80,
1430 #[doc = "Control autonomous path planning on the MAV."]
1431 MAV_CMD_NAV_PATHPLANNING = 81,
1432 #[doc = "Navigate to waypoint using a spline path."]
1433 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1434 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1435 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1436 #[doc = "Land using VTOL mode"]
1437 MAV_CMD_NAV_VTOL_LAND = 85,
1438 #[doc = "hand control over to an external controller"]
1439 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1440 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1441 MAV_CMD_NAV_DELAY = 93,
1442 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1443 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1444 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1445 MAV_CMD_NAV_LAST = 95,
1446 #[doc = "Delay mission state machine."]
1447 MAV_CMD_CONDITION_DELAY = 112,
1448 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1449 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1450 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1451 MAV_CMD_CONDITION_DISTANCE = 114,
1452 #[doc = "Reach a certain target angle."]
1453 MAV_CMD_CONDITION_YAW = 115,
1454 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1455 MAV_CMD_CONDITION_LAST = 159,
1456 #[doc = "Set system mode."]
1457 MAV_CMD_DO_SET_MODE = 176,
1458 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1459 MAV_CMD_DO_JUMP = 177,
1460 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1461 MAV_CMD_DO_CHANGE_SPEED = 178,
1462 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1463 MAV_CMD_DO_SET_HOME = 179,
1464 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1465 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1466 MAV_CMD_DO_SET_PARAMETER = 180,
1467 #[doc = "Set a relay to a condition."]
1468 MAV_CMD_DO_SET_RELAY = 181,
1469 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1470 MAV_CMD_DO_REPEAT_RELAY = 182,
1471 #[doc = "Set a servo to a desired PWM value."]
1472 MAV_CMD_DO_SET_SERVO = 183,
1473 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1474 MAV_CMD_DO_REPEAT_SERVO = 184,
1475 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1476 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1477 #[doc = "Change altitude set point."]
1478 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1479 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1480 MAV_CMD_DO_SET_ACTUATOR = 187,
1481 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1482 MAV_CMD_DO_RETURN_PATH_START = 188,
1483 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1484 MAV_CMD_DO_LAND_START = 189,
1485 #[doc = "Mission command to perform a landing from a rally point."]
1486 MAV_CMD_DO_RALLY_LAND = 190,
1487 #[doc = "Mission command to safely abort an autonomous landing."]
1488 MAV_CMD_DO_GO_AROUND = 191,
1489 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1490 MAV_CMD_DO_REPOSITION = 192,
1491 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1492 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1493 #[doc = "Set moving direction to forward or reverse."]
1494 MAV_CMD_DO_SET_REVERSE = 194,
1495 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1496 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1497 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1499 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1500 MAV_CMD_DO_SET_ROI_NONE = 197,
1501 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1502 MAV_CMD_DO_SET_ROI_SYSID = 198,
1503 #[doc = "Control onboard camera system."]
1504 MAV_CMD_DO_CONTROL_VIDEO = 200,
1505 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1506 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1507 MAV_CMD_DO_SET_ROI = 201,
1508 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1509 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1510 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1512 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1513 #[doc = "Mission command to configure a camera or antenna mount"]
1514 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1515 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1516 #[doc = "Mission command to control a camera or antenna mount"]
1517 MAV_CMD_DO_MOUNT_CONTROL = 205,
1518 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1519 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1520 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1521 MAV_CMD_DO_FENCE_ENABLE = 207,
1522 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1523 MAV_CMD_DO_PARACHUTE = 208,
1524 #[doc = "Command to perform motor test."]
1525 MAV_CMD_DO_MOTOR_TEST = 209,
1526 #[doc = "Change to/from inverted flight."]
1527 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1528 #[doc = "Mission command to operate a gripper."]
1529 MAV_CMD_DO_GRIPPER = 211,
1530 #[doc = "Enable/disable autotune."]
1531 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1532 #[doc = "Sets a desired vehicle turn angle and speed change."]
1533 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1534 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1535 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1536 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1537 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1538 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1539 #[doc = "set id of master controller"]
1540 MAV_CMD_DO_GUIDED_MASTER = 221,
1541 #[doc = "Set limits for external control"]
1542 MAV_CMD_DO_GUIDED_LIMITS = 222,
1543 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1544 MAV_CMD_DO_ENGINE_CONTROL = 223,
1545 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1546 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1547 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1548 MAV_CMD_DO_LAST = 240,
1549 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1550 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1551 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1552 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1553 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1554 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1555 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1556 MAV_CMD_PREFLIGHT_STORAGE = 245,
1557 #[doc = "Request the reboot or shutdown of system components."]
1558 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1559 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1560 MAV_CMD_OVERRIDE_GOTO = 252,
1561 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1562 MAV_CMD_OBLIQUE_SURVEY = 260,
1563 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1564 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1565 #[doc = "start running a mission"]
1566 MAV_CMD_MISSION_START = 300,
1567 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1568 MAV_CMD_ACTUATOR_TEST = 310,
1569 #[doc = "Actuator configuration command."]
1570 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1571 #[doc = "Arms / Disarms a component"]
1572 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1573 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1574 MAV_CMD_RUN_PREARM_CHECKS = 401,
1575 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1576 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1577 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1579 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1580 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1581 MAV_CMD_GET_HOME_POSITION = 410,
1582 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1583 MAV_CMD_INJECT_FAILURE = 420,
1584 #[doc = "Starts receiver pairing."]
1585 MAV_CMD_START_RX_PAIR = 500,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1587 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1588 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1589 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1590 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1591 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1592 MAV_CMD_REQUEST_MESSAGE = 512,
1593 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1594 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1595 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1596 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1597 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1598 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1599 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1600 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1601 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1602 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1603 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1604 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1605 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1606 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1607 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1608 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_STORAGE_FORMAT = 526,
1610 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1611 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1612 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1613 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1614 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1615 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1616 #[doc = "Reset all camera settings to Factory Default"]
1617 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1618 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1619 MAV_CMD_SET_CAMERA_MODE = 530,
1620 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1621 MAV_CMD_SET_CAMERA_ZOOM = 531,
1622 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_FOCUS = 532,
1624 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1625 MAV_CMD_SET_STORAGE_USAGE = 533,
1626 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1627 MAV_CMD_SET_CAMERA_SOURCE = 534,
1628 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1629 MAV_CMD_JUMP_TAG = 600,
1630 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1631 MAV_CMD_DO_JUMP_TAG = 601,
1632 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1633 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1634 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1636 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1637 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1638 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1640 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1641 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1642 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1643 #[doc = "Enable or disable on-board camera triggering system."]
1644 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1645 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1646 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1647 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1649 #[doc = "Stops ongoing tracking."]
1650 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1651 #[doc = "Starts video capture (recording)."]
1652 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1653 #[doc = "Stop the current video capture (recording)."]
1654 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1655 #[doc = "Start video streaming"]
1656 MAV_CMD_VIDEO_START_STREAMING = 2502,
1657 #[doc = "Stop the given video stream"]
1658 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1659 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1660 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1661 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1662 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1663 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1664 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1665 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1666 MAV_CMD_LOGGING_START = 2510,
1667 #[doc = "Request to stop streaming log data over MAVLink"]
1668 MAV_CMD_LOGGING_STOP = 2511,
1669 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1670 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1671 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1672 #[doc = "Create a panorama at the current position"]
1673 MAV_CMD_PANORAMA_CREATE = 2800,
1674 #[doc = "Request VTOL transition"]
1675 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1676 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1677 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1678 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1679 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1680 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1682 #[doc = "Delay mission state machine until gate has been reached."]
1683 MAV_CMD_CONDITION_GATE = 4501,
1684 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1685 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1686 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1687 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1688 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1690 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1691 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1692 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1694 #[doc = "Rally point. You can have multiple rally points defined."]
1695 MAV_CMD_NAV_RALLY_POINT = 5100,
1696 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1697 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1698 #[doc = "Change state of safety switch."]
1699 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1700 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1701 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1702 #[deprecated = " (Deprecated since 2021-06)"]
1703 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1704 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1705 #[deprecated = " (Deprecated since 2021-06)"]
1706 #[doc = "Control the payload deployment."]
1707 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1708 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1709 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1710 #[doc = "Command to operate winch."]
1711 MAV_CMD_DO_WINCH = 42600,
1712 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1713 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1714 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1715 MAV_CMD_WAYPOINT_USER_1 = 31000,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_2 = 31001,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_3 = 31002,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_4 = 31003,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_5 = 31004,
1724 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1725 MAV_CMD_SPATIAL_USER_1 = 31005,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_2 = 31006,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_3 = 31007,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_4 = 31008,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_5 = 31009,
1734 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1735 MAV_CMD_USER_1 = 31010,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_2 = 31011,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_3 = 31012,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_4 = 31013,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_5 = 31014,
1744 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1745 MAV_CMD_CAN_FORWARD = 32000,
1746}
1747impl MavCmd {
1748 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1749}
1750impl Default for MavCmd {
1751 fn default() -> Self {
1752 Self::DEFAULT
1753 }
1754}
1755#[cfg_attr(feature = "ts", derive(TS))]
1756#[cfg_attr(feature = "ts", ts(export))]
1757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1759#[cfg_attr(feature = "serde", serde(tag = "type"))]
1760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1761#[repr(u32)]
1762#[doc = "Possible actions an aircraft can take to avoid a collision."]
1763pub enum MavCollisionAction {
1764 #[doc = "Ignore any potential collisions"]
1765 MAV_COLLISION_ACTION_NONE = 0,
1766 #[doc = "Report potential collision"]
1767 MAV_COLLISION_ACTION_REPORT = 1,
1768 #[doc = "Ascend or Descend to avoid threat"]
1769 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1770 #[doc = "Move horizontally to avoid threat"]
1771 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1772 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1773 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1774 #[doc = "Aircraft to fly directly back to its launch point"]
1775 MAV_COLLISION_ACTION_RTL = 5,
1776 #[doc = "Aircraft to stop in place"]
1777 MAV_COLLISION_ACTION_HOVER = 6,
1778}
1779impl MavCollisionAction {
1780 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1781}
1782impl Default for MavCollisionAction {
1783 fn default() -> Self {
1784 Self::DEFAULT
1785 }
1786}
1787#[cfg_attr(feature = "ts", derive(TS))]
1788#[cfg_attr(feature = "ts", ts(export))]
1789#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1791#[cfg_attr(feature = "serde", serde(tag = "type"))]
1792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1793#[repr(u32)]
1794#[doc = "Source of information about this collision."]
1795pub enum MavCollisionSrc {
1796 #[doc = "ID field references ADSB_VEHICLE packets"]
1797 MAV_COLLISION_SRC_ADSB = 0,
1798 #[doc = "ID field references MAVLink SRC ID"]
1799 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1800}
1801impl MavCollisionSrc {
1802 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1803}
1804impl Default for MavCollisionSrc {
1805 fn default() -> Self {
1806 Self::DEFAULT
1807 }
1808}
1809#[cfg_attr(feature = "ts", derive(TS))]
1810#[cfg_attr(feature = "ts", ts(export))]
1811#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1813#[cfg_attr(feature = "serde", serde(tag = "type"))]
1814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1815#[repr(u32)]
1816#[doc = "Aircraft-rated danger from this threat."]
1817pub enum MavCollisionThreatLevel {
1818 #[doc = "Not a threat"]
1819 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1820 #[doc = "Craft is mildly concerned about this threat"]
1821 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1822 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1823 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1824}
1825impl MavCollisionThreatLevel {
1826 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1827}
1828impl Default for MavCollisionThreatLevel {
1829 fn default() -> Self {
1830 Self::DEFAULT
1831 }
1832}
1833#[cfg_attr(feature = "ts", derive(TS))]
1834#[cfg_attr(feature = "ts", ts(export))]
1835#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1837#[cfg_attr(feature = "serde", serde(tag = "type"))]
1838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1839#[repr(u32)]
1840#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1841pub enum MavComponent {
1842 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1843 MAV_COMP_ID_ALL = 0,
1844 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1845 MAV_COMP_ID_AUTOPILOT1 = 1,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER1 = 25,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER2 = 26,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER3 = 27,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER4 = 28,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER5 = 29,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER6 = 30,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER7 = 31,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER8 = 32,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER9 = 33,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER10 = 34,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER11 = 35,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER12 = 36,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER13 = 37,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER14 = 38,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER15 = 39,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER16 = 40,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER17 = 41,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER18 = 42,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER19 = 43,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER20 = 44,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER21 = 45,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER22 = 46,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER23 = 47,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER24 = 48,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER25 = 49,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER26 = 50,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER27 = 51,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER28 = 52,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER29 = 53,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER30 = 54,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER31 = 55,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER32 = 56,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER33 = 57,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER34 = 58,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER35 = 59,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER36 = 60,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER37 = 61,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER38 = 62,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER39 = 63,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER40 = 64,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER41 = 65,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER42 = 66,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER43 = 67,
1932 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1933 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1934 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1935 MAV_COMP_ID_USER45 = 69,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER46 = 70,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER47 = 71,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER48 = 72,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER49 = 73,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER50 = 74,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER51 = 75,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER52 = 76,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER53 = 77,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER54 = 78,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER55 = 79,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER56 = 80,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER57 = 81,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER58 = 82,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER59 = 83,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER60 = 84,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER61 = 85,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER62 = 86,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER63 = 87,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER64 = 88,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER65 = 89,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER66 = 90,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER67 = 91,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER68 = 92,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER69 = 93,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER70 = 94,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER71 = 95,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER72 = 96,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER73 = 97,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER74 = 98,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER75 = 99,
1996 #[doc = "Camera #1."]
1997 MAV_COMP_ID_CAMERA = 100,
1998 #[doc = "Camera #2."]
1999 MAV_COMP_ID_CAMERA2 = 101,
2000 #[doc = "Camera #3."]
2001 MAV_COMP_ID_CAMERA3 = 102,
2002 #[doc = "Camera #4."]
2003 MAV_COMP_ID_CAMERA4 = 103,
2004 #[doc = "Camera #5."]
2005 MAV_COMP_ID_CAMERA5 = 104,
2006 #[doc = "Camera #6."]
2007 MAV_COMP_ID_CAMERA6 = 105,
2008 #[doc = "Servo #1."]
2009 MAV_COMP_ID_SERVO1 = 140,
2010 #[doc = "Servo #2."]
2011 MAV_COMP_ID_SERVO2 = 141,
2012 #[doc = "Servo #3."]
2013 MAV_COMP_ID_SERVO3 = 142,
2014 #[doc = "Servo #4."]
2015 MAV_COMP_ID_SERVO4 = 143,
2016 #[doc = "Servo #5."]
2017 MAV_COMP_ID_SERVO5 = 144,
2018 #[doc = "Servo #6."]
2019 MAV_COMP_ID_SERVO6 = 145,
2020 #[doc = "Servo #7."]
2021 MAV_COMP_ID_SERVO7 = 146,
2022 #[doc = "Servo #8."]
2023 MAV_COMP_ID_SERVO8 = 147,
2024 #[doc = "Servo #9."]
2025 MAV_COMP_ID_SERVO9 = 148,
2026 #[doc = "Servo #10."]
2027 MAV_COMP_ID_SERVO10 = 149,
2028 #[doc = "Servo #11."]
2029 MAV_COMP_ID_SERVO11 = 150,
2030 #[doc = "Servo #12."]
2031 MAV_COMP_ID_SERVO12 = 151,
2032 #[doc = "Servo #13."]
2033 MAV_COMP_ID_SERVO13 = 152,
2034 #[doc = "Servo #14."]
2035 MAV_COMP_ID_SERVO14 = 153,
2036 #[doc = "Gimbal #1."]
2037 MAV_COMP_ID_GIMBAL = 154,
2038 #[doc = "Logging component."]
2039 MAV_COMP_ID_LOG = 155,
2040 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2041 MAV_COMP_ID_ADSB = 156,
2042 #[doc = "On Screen Display (OSD) devices for video links."]
2043 MAV_COMP_ID_OSD = 157,
2044 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2045 MAV_COMP_ID_PERIPHERAL = 158,
2046 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2047 #[doc = "Gimbal ID for QX1."]
2048 MAV_COMP_ID_QX1_GIMBAL = 159,
2049 #[doc = "FLARM collision alert component."]
2050 MAV_COMP_ID_FLARM = 160,
2051 #[doc = "Parachute component."]
2052 MAV_COMP_ID_PARACHUTE = 161,
2053 #[doc = "Winch component."]
2054 MAV_COMP_ID_WINCH = 169,
2055 #[doc = "Gimbal #2."]
2056 MAV_COMP_ID_GIMBAL2 = 171,
2057 #[doc = "Gimbal #3."]
2058 MAV_COMP_ID_GIMBAL3 = 172,
2059 #[doc = "Gimbal #4"]
2060 MAV_COMP_ID_GIMBAL4 = 173,
2061 #[doc = "Gimbal #5."]
2062 MAV_COMP_ID_GIMBAL5 = 174,
2063 #[doc = "Gimbal #6."]
2064 MAV_COMP_ID_GIMBAL6 = 175,
2065 #[doc = "Battery #1."]
2066 MAV_COMP_ID_BATTERY = 180,
2067 #[doc = "Battery #2."]
2068 MAV_COMP_ID_BATTERY2 = 181,
2069 #[doc = "CAN over MAVLink client."]
2070 MAV_COMP_ID_MAVCAN = 189,
2071 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2072 MAV_COMP_ID_MISSIONPLANNER = 190,
2073 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2074 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2081 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2082 MAV_COMP_ID_PATHPLANNER = 195,
2083 #[doc = "Component that plans a collision free path between two points."]
2084 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2085 #[doc = "Component that provides position estimates using VIO techniques."]
2086 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2087 #[doc = "Component that manages pairing of vehicle and GCS."]
2088 MAV_COMP_ID_PAIRING_MANAGER = 198,
2089 #[doc = "Inertial Measurement Unit (IMU) #1."]
2090 MAV_COMP_ID_IMU = 200,
2091 #[doc = "Inertial Measurement Unit (IMU) #2."]
2092 MAV_COMP_ID_IMU_2 = 201,
2093 #[doc = "Inertial Measurement Unit (IMU) #3."]
2094 MAV_COMP_ID_IMU_3 = 202,
2095 #[doc = "GPS #1."]
2096 MAV_COMP_ID_GPS = 220,
2097 #[doc = "GPS #2."]
2098 MAV_COMP_ID_GPS2 = 221,
2099 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2100 MAV_COMP_ID_ODID_TXRX_1 = 236,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_2 = 237,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_3 = 238,
2105 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2106 MAV_COMP_ID_UDP_BRIDGE = 240,
2107 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2108 MAV_COMP_ID_UART_BRIDGE = 241,
2109 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2110 MAV_COMP_ID_TUNNEL_NODE = 242,
2111 #[doc = "Illuminator"]
2112 MAV_COMP_ID_ILLUMINATOR = 243,
2113 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2114 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2115 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2116}
2117impl MavComponent {
2118 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2119}
2120impl Default for MavComponent {
2121 fn default() -> Self {
2122 Self::DEFAULT
2123 }
2124}
2125#[cfg_attr(feature = "ts", derive(TS))]
2126#[cfg_attr(feature = "ts", ts(export))]
2127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2129#[cfg_attr(feature = "serde", serde(tag = "type"))]
2130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2131#[repr(u32)]
2132#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2133#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2134pub enum MavDataStream {
2135 #[doc = "Enable all data streams"]
2136 MAV_DATA_STREAM_ALL = 0,
2137 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2138 MAV_DATA_STREAM_RAW_SENSORS = 1,
2139 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2140 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2141 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2142 MAV_DATA_STREAM_RC_CHANNELS = 3,
2143 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2144 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2145 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2146 MAV_DATA_STREAM_POSITION = 6,
2147 #[doc = "Dependent on the autopilot"]
2148 MAV_DATA_STREAM_EXTRA1 = 10,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA2 = 11,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA3 = 12,
2153}
2154impl MavDataStream {
2155 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2156}
2157impl Default for MavDataStream {
2158 fn default() -> Self {
2159 Self::DEFAULT
2160 }
2161}
2162#[cfg_attr(feature = "ts", derive(TS))]
2163#[cfg_attr(feature = "ts", ts(export))]
2164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2166#[cfg_attr(feature = "serde", serde(tag = "type"))]
2167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2168#[repr(u32)]
2169#[doc = "Enumeration of distance sensor types"]
2170pub enum MavDistanceSensor {
2171 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2172 MAV_DISTANCE_SENSOR_LASER = 0,
2173 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2174 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2175 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2176 MAV_DISTANCE_SENSOR_INFRARED = 2,
2177 #[doc = "Radar type, e.g. uLanding units"]
2178 MAV_DISTANCE_SENSOR_RADAR = 3,
2179 #[doc = "Broken or unknown type, e.g. analog units"]
2180 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2181}
2182impl MavDistanceSensor {
2183 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2184}
2185impl Default for MavDistanceSensor {
2186 fn default() -> Self {
2187 Self::DEFAULT
2188 }
2189}
2190#[cfg_attr(feature = "ts", derive(TS))]
2191#[cfg_attr(feature = "ts", ts(export))]
2192#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2194#[cfg_attr(feature = "serde", serde(tag = "type"))]
2195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2196#[repr(u32)]
2197#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2198pub enum MavDoRepositionFlags {
2199 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2200 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2201}
2202impl MavDoRepositionFlags {
2203 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2204}
2205impl Default for MavDoRepositionFlags {
2206 fn default() -> Self {
2207 Self::DEFAULT
2208 }
2209}
2210#[cfg_attr(feature = "ts", derive(TS))]
2211#[cfg_attr(feature = "ts", ts(export))]
2212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2214#[cfg_attr(feature = "serde", serde(tag = "type"))]
2215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2216#[repr(u32)]
2217#[doc = "Enumeration of estimator types"]
2218pub enum MavEstimatorType {
2219 #[doc = "Unknown type of the estimator."]
2220 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2221 #[doc = "This is a naive estimator without any real covariance feedback."]
2222 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2223 #[doc = "Computer vision based estimate. Might be up to scale."]
2224 MAV_ESTIMATOR_TYPE_VISION = 2,
2225 #[doc = "Visual-inertial estimate."]
2226 MAV_ESTIMATOR_TYPE_VIO = 3,
2227 #[doc = "Plain GPS estimate."]
2228 MAV_ESTIMATOR_TYPE_GPS = 4,
2229 #[doc = "Estimator integrating GPS and inertial sensing."]
2230 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2231 #[doc = "Estimate from external motion capturing system."]
2232 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2233 #[doc = "Estimator based on lidar sensor input."]
2234 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2235 #[doc = "Estimator on autopilot."]
2236 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2237}
2238impl MavEstimatorType {
2239 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2240}
2241impl Default for MavEstimatorType {
2242 fn default() -> Self {
2243 Self::DEFAULT
2244 }
2245}
2246#[cfg_attr(feature = "ts", derive(TS))]
2247#[cfg_attr(feature = "ts", ts(export))]
2248#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2250#[cfg_attr(feature = "serde", serde(tag = "type"))]
2251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2252#[repr(u32)]
2253#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2254pub enum MavEventCurrentSequenceFlags {
2255 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2256 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2257}
2258impl MavEventCurrentSequenceFlags {
2259 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2260}
2261impl Default for MavEventCurrentSequenceFlags {
2262 fn default() -> Self {
2263 Self::DEFAULT
2264 }
2265}
2266#[cfg_attr(feature = "ts", derive(TS))]
2267#[cfg_attr(feature = "ts", ts(export))]
2268#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2269#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2270#[cfg_attr(feature = "serde", serde(tag = "type"))]
2271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2272#[repr(u32)]
2273#[doc = "Reason for an event error response."]
2274pub enum MavEventErrorReason {
2275 #[doc = "The requested event is not available (anymore)."]
2276 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2277}
2278impl MavEventErrorReason {
2279 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2280}
2281impl Default for MavEventErrorReason {
2282 fn default() -> Self {
2283 Self::DEFAULT
2284 }
2285}
2286#[cfg_attr(feature = "ts", derive(TS))]
2287#[cfg_attr(feature = "ts", ts(export))]
2288#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2290#[cfg_attr(feature = "serde", serde(tag = "type"))]
2291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2292#[repr(u32)]
2293#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2294pub enum MavFrame {
2295 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2296 MAV_FRAME_GLOBAL = 0,
2297 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2298 MAV_FRAME_LOCAL_NED = 1,
2299 #[doc = "NOT a coordinate frame, indicates a mission command."]
2300 MAV_FRAME_MISSION = 2,
2301 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2302 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2303 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2304 MAV_FRAME_LOCAL_ENU = 4,
2305 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2306 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2307 MAV_FRAME_GLOBAL_INT = 5,
2308 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2309 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2310 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2311 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2312 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2313 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2314 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2315 MAV_FRAME_BODY_NED = 8,
2316 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2317 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2318 MAV_FRAME_BODY_OFFSET_NED = 9,
2319 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2320 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2321 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2322 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2323 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2324 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2325 MAV_FRAME_BODY_FRD = 12,
2326 #[deprecated = " (Deprecated since 2019-04)"]
2327 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2328 MAV_FRAME_RESERVED_13 = 13,
2329 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2330 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2331 MAV_FRAME_RESERVED_14 = 14,
2332 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2333 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2334 MAV_FRAME_RESERVED_15 = 15,
2335 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2336 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2337 MAV_FRAME_RESERVED_16 = 16,
2338 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2339 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2340 MAV_FRAME_RESERVED_17 = 17,
2341 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2342 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2343 MAV_FRAME_RESERVED_18 = 18,
2344 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2345 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2346 MAV_FRAME_RESERVED_19 = 19,
2347 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2348 MAV_FRAME_LOCAL_FRD = 20,
2349 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FLU = 21,
2351}
2352impl MavFrame {
2353 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2354}
2355impl Default for MavFrame {
2356 fn default() -> Self {
2357 Self::DEFAULT
2358 }
2359}
2360#[cfg_attr(feature = "ts", derive(TS))]
2361#[cfg_attr(feature = "ts", ts(export))]
2362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2364#[cfg_attr(feature = "serde", serde(tag = "type"))]
2365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2366#[repr(u32)]
2367#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2368pub enum MavFtpErr {
2369 #[doc = "None: No error"]
2370 MAV_FTP_ERR_NONE = 0,
2371 #[doc = "Fail: Unknown failure"]
2372 MAV_FTP_ERR_FAIL = 1,
2373 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2374 MAV_FTP_ERR_FAILERRNO = 2,
2375 #[doc = "InvalidDataSize: Payload size is invalid"]
2376 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2377 #[doc = "InvalidSession: Session is not currently open"]
2378 MAV_FTP_ERR_INVALIDSESSION = 4,
2379 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2380 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2381 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2382 MAV_FTP_ERR_EOF = 6,
2383 #[doc = "UnknownCommand: Unknown command / opcode"]
2384 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2385 #[doc = "FileExists: File/directory already exists"]
2386 MAV_FTP_ERR_FILEEXISTS = 8,
2387 #[doc = "FileProtected: File/directory is write protected"]
2388 MAV_FTP_ERR_FILEPROTECTED = 9,
2389 #[doc = "FileNotFound: File/directory not found"]
2390 MAV_FTP_ERR_FILENOTFOUND = 10,
2391}
2392impl MavFtpErr {
2393 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2394}
2395impl Default for MavFtpErr {
2396 fn default() -> Self {
2397 Self::DEFAULT
2398 }
2399}
2400#[cfg_attr(feature = "ts", derive(TS))]
2401#[cfg_attr(feature = "ts", ts(export))]
2402#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2404#[cfg_attr(feature = "serde", serde(tag = "type"))]
2405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2406#[repr(u32)]
2407#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2408pub enum MavFtpOpcode {
2409 #[doc = "None. Ignored, always ACKed"]
2410 MAV_FTP_OPCODE_NONE = 0,
2411 #[doc = "TerminateSession: Terminates open Read session"]
2412 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2413 #[doc = "ResetSessions: Terminates all open read sessions"]
2414 MAV_FTP_OPCODE_RESETSESSION = 2,
2415 #[doc = "ListDirectory. List files and directories in path from offset"]
2416 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2417 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2418 MAV_FTP_OPCODE_OPENFILERO = 4,
2419 #[doc = "ReadFile: Reads size bytes from offset in session"]
2420 MAV_FTP_OPCODE_READFILE = 5,
2421 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2422 MAV_FTP_OPCODE_CREATEFILE = 6,
2423 #[doc = "WriteFile: Writes size bytes to offset in session"]
2424 MAV_FTP_OPCODE_WRITEFILE = 7,
2425 #[doc = "RemoveFile: Remove file at path"]
2426 MAV_FTP_OPCODE_REMOVEFILE = 8,
2427 #[doc = "CreateDirectory: Creates directory at path"]
2428 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2429 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2430 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2431 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2432 MAV_FTP_OPCODE_OPENFILEWO = 11,
2433 #[doc = "TruncateFile: Truncate file at path to offset length"]
2434 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2435 #[doc = "Rename: Rename path1 to path2"]
2436 MAV_FTP_OPCODE_RENAME = 13,
2437 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2438 MAV_FTP_OPCODE_CALCFILECRC = 14,
2439 #[doc = "BurstReadFile: Burst download session file"]
2440 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2441 #[doc = "ACK: ACK response"]
2442 MAV_FTP_OPCODE_ACK = 128,
2443 #[doc = "NAK: NAK response"]
2444 MAV_FTP_OPCODE_NAK = 129,
2445}
2446impl MavFtpOpcode {
2447 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2448}
2449impl Default for MavFtpOpcode {
2450 fn default() -> Self {
2451 Self::DEFAULT
2452 }
2453}
2454#[cfg_attr(feature = "ts", derive(TS))]
2455#[cfg_attr(feature = "ts", ts(export))]
2456#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2458#[cfg_attr(feature = "serde", serde(tag = "type"))]
2459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2460#[repr(u32)]
2461#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2462pub enum MavFuelType {
2463 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2464 MAV_FUEL_TYPE_UNKNOWN = 0,
2465 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2466 MAV_FUEL_TYPE_LIQUID = 1,
2467 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2468 MAV_FUEL_TYPE_GAS = 2,
2469}
2470impl MavFuelType {
2471 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2472}
2473impl Default for MavFuelType {
2474 fn default() -> Self {
2475 Self::DEFAULT
2476 }
2477}
2478bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2479impl MavGeneratorStatusFlag {
2480 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2481}
2482impl Default for MavGeneratorStatusFlag {
2483 fn default() -> Self {
2484 Self::DEFAULT
2485 }
2486}
2487#[cfg_attr(feature = "ts", derive(TS))]
2488#[cfg_attr(feature = "ts", ts(export))]
2489#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2491#[cfg_attr(feature = "serde", serde(tag = "type"))]
2492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2493#[repr(u32)]
2494#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2495pub enum MavGoto {
2496 #[doc = "Hold at the current position."]
2497 MAV_GOTO_DO_HOLD = 0,
2498 #[doc = "Continue with the next item in mission execution."]
2499 MAV_GOTO_DO_CONTINUE = 1,
2500 #[doc = "Hold at the current position of the system"]
2501 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2502 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2503 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2504}
2505impl MavGoto {
2506 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2507}
2508impl Default for MavGoto {
2509 fn default() -> Self {
2510 Self::DEFAULT
2511 }
2512}
2513#[cfg_attr(feature = "ts", derive(TS))]
2514#[cfg_attr(feature = "ts", ts(export))]
2515#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2516#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2517#[cfg_attr(feature = "serde", serde(tag = "type"))]
2518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2519#[repr(u32)]
2520#[doc = "Enumeration of landed detector states"]
2521pub enum MavLandedState {
2522 #[doc = "MAV landed state is unknown"]
2523 MAV_LANDED_STATE_UNDEFINED = 0,
2524 #[doc = "MAV is landed (on ground)"]
2525 MAV_LANDED_STATE_ON_GROUND = 1,
2526 #[doc = "MAV is in air"]
2527 MAV_LANDED_STATE_IN_AIR = 2,
2528 #[doc = "MAV currently taking off"]
2529 MAV_LANDED_STATE_TAKEOFF = 3,
2530 #[doc = "MAV currently landing"]
2531 MAV_LANDED_STATE_LANDING = 4,
2532}
2533impl MavLandedState {
2534 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2535}
2536impl Default for MavLandedState {
2537 fn default() -> Self {
2538 Self::DEFAULT
2539 }
2540}
2541#[cfg_attr(feature = "ts", derive(TS))]
2542#[cfg_attr(feature = "ts", ts(export))]
2543#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2545#[cfg_attr(feature = "serde", serde(tag = "type"))]
2546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2547#[repr(u32)]
2548#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2549pub enum MavMissionResult {
2550 #[doc = "mission accepted OK"]
2551 MAV_MISSION_ACCEPTED = 0,
2552 #[doc = "Generic error / not accepting mission commands at all right now."]
2553 MAV_MISSION_ERROR = 1,
2554 #[doc = "Coordinate frame is not supported."]
2555 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2556 #[doc = "Command is not supported."]
2557 MAV_MISSION_UNSUPPORTED = 3,
2558 #[doc = "Mission items exceed storage space."]
2559 MAV_MISSION_NO_SPACE = 4,
2560 #[doc = "One of the parameters has an invalid value."]
2561 MAV_MISSION_INVALID = 5,
2562 #[doc = "param1 has an invalid value."]
2563 MAV_MISSION_INVALID_PARAM1 = 6,
2564 #[doc = "param2 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM2 = 7,
2566 #[doc = "param3 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM3 = 8,
2568 #[doc = "param4 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM4 = 9,
2570 #[doc = "x / param5 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM5_X = 10,
2572 #[doc = "y / param6 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM6_Y = 11,
2574 #[doc = "z / param7 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM7 = 12,
2576 #[doc = "Mission item received out of sequence"]
2577 MAV_MISSION_INVALID_SEQUENCE = 13,
2578 #[doc = "Not accepting any mission commands from this communication partner."]
2579 MAV_MISSION_DENIED = 14,
2580 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2581 MAV_MISSION_OPERATION_CANCELLED = 15,
2582}
2583impl MavMissionResult {
2584 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2585}
2586impl Default for MavMissionResult {
2587 fn default() -> Self {
2588 Self::DEFAULT
2589 }
2590}
2591#[cfg_attr(feature = "ts", derive(TS))]
2592#[cfg_attr(feature = "ts", ts(export))]
2593#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2595#[cfg_attr(feature = "serde", serde(tag = "type"))]
2596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2597#[repr(u32)]
2598#[doc = "Type of mission items being requested/sent in mission protocol."]
2599pub enum MavMissionType {
2600 #[doc = "Items are mission commands for main mission."]
2601 MAV_MISSION_TYPE_MISSION = 0,
2602 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2603 MAV_MISSION_TYPE_FENCE = 1,
2604 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2605 MAV_MISSION_TYPE_RALLY = 2,
2606 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2607 MAV_MISSION_TYPE_ALL = 255,
2608}
2609impl MavMissionType {
2610 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2611}
2612impl Default for MavMissionType {
2613 fn default() -> Self {
2614 Self::DEFAULT
2615 }
2616}
2617#[cfg_attr(feature = "ts", derive(TS))]
2618#[cfg_attr(feature = "ts", ts(export))]
2619#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2621#[cfg_attr(feature = "serde", serde(tag = "type"))]
2622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2623#[repr(u32)]
2624#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2625pub enum MavMode {
2626 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2627 MAV_MODE_PREFLIGHT = 0,
2628 #[doc = "System is allowed to be active, under assisted RC control."]
2629 MAV_MODE_STABILIZE_DISARMED = 80,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_ARMED = 208,
2632 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2633 MAV_MODE_MANUAL_DISARMED = 64,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_ARMED = 192,
2636 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2637 MAV_MODE_GUIDED_DISARMED = 88,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_ARMED = 216,
2640 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2641 MAV_MODE_AUTO_DISARMED = 92,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_ARMED = 220,
2644 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2645 MAV_MODE_TEST_DISARMED = 66,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_ARMED = 194,
2648}
2649impl MavMode {
2650 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2651}
2652impl Default for MavMode {
2653 fn default() -> Self {
2654 Self::DEFAULT
2655 }
2656}
2657bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2658impl MavModeFlag {
2659 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2660}
2661impl Default for MavModeFlag {
2662 fn default() -> Self {
2663 Self::DEFAULT
2664 }
2665}
2666#[cfg_attr(feature = "ts", derive(TS))]
2667#[cfg_attr(feature = "ts", ts(export))]
2668#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2670#[cfg_attr(feature = "serde", serde(tag = "type"))]
2671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2672#[repr(u32)]
2673#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2674pub enum MavModeFlagDecodePosition {
2675 #[doc = "First bit: 10000000"]
2676 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2677 #[doc = "Second bit: 01000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2679 #[doc = "Third bit: 00100000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2681 #[doc = "Fourth bit: 00010000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2683 #[doc = "Fifth bit: 00001000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2685 #[doc = "Sixth bit: 00000100"]
2686 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2687 #[doc = "Seventh bit: 00000010"]
2688 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2689 #[doc = "Eighth bit: 00000001"]
2690 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2691}
2692impl MavModeFlagDecodePosition {
2693 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2694}
2695impl Default for MavModeFlagDecodePosition {
2696 fn default() -> Self {
2697 Self::DEFAULT
2698 }
2699}
2700bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2701impl MavModeProperty {
2702 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2703}
2704impl Default for MavModeProperty {
2705 fn default() -> Self {
2706 Self::DEFAULT
2707 }
2708}
2709#[cfg_attr(feature = "ts", derive(TS))]
2710#[cfg_attr(feature = "ts", ts(export))]
2711#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2713#[cfg_attr(feature = "serde", serde(tag = "type"))]
2714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2715#[repr(u32)]
2716#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2717#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2718pub enum MavMountMode {
2719 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2720 MAV_MOUNT_MODE_RETRACT = 0,
2721 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2722 MAV_MOUNT_MODE_NEUTRAL = 1,
2723 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2724 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2725 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_RC_TARGETING = 3,
2727 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2728 MAV_MOUNT_MODE_GPS_POINT = 4,
2729 #[doc = "Gimbal tracks system with specified system ID"]
2730 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2731 #[doc = "Gimbal tracks home position"]
2732 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2733}
2734impl MavMountMode {
2735 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2736}
2737impl Default for MavMountMode {
2738 fn default() -> Self {
2739 Self::DEFAULT
2740 }
2741}
2742#[cfg_attr(feature = "ts", derive(TS))]
2743#[cfg_attr(feature = "ts", ts(export))]
2744#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2746#[cfg_attr(feature = "serde", serde(tag = "type"))]
2747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2748#[repr(u32)]
2749pub enum MavOdidArmStatus {
2750 #[doc = "Passing arming checks."]
2751 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2752 #[doc = "Generic arming failure, see error string for details."]
2753 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2754}
2755impl MavOdidArmStatus {
2756 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2757}
2758impl Default for MavOdidArmStatus {
2759 fn default() -> Self {
2760 Self::DEFAULT
2761 }
2762}
2763#[cfg_attr(feature = "ts", derive(TS))]
2764#[cfg_attr(feature = "ts", ts(export))]
2765#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2767#[cfg_attr(feature = "serde", serde(tag = "type"))]
2768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2769#[repr(u32)]
2770pub enum MavOdidAuthType {
2771 #[doc = "No authentication type is specified."]
2772 MAV_ODID_AUTH_TYPE_NONE = 0,
2773 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2774 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2775 #[doc = "Signature for the Operator ID."]
2776 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2777 #[doc = "Signature for the entire message set."]
2778 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2779 #[doc = "Authentication is provided by Network Remote ID."]
2780 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2781 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2782 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2783}
2784impl MavOdidAuthType {
2785 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2786}
2787impl Default for MavOdidAuthType {
2788 fn default() -> Self {
2789 Self::DEFAULT
2790 }
2791}
2792#[cfg_attr(feature = "ts", derive(TS))]
2793#[cfg_attr(feature = "ts", ts(export))]
2794#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2796#[cfg_attr(feature = "serde", serde(tag = "type"))]
2797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2798#[repr(u32)]
2799pub enum MavOdidCategoryEu {
2800 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2801 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2802 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2803 MAV_ODID_CATEGORY_EU_OPEN = 1,
2804 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2805 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2806 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2807 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2808}
2809impl MavOdidCategoryEu {
2810 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2811}
2812impl Default for MavOdidCategoryEu {
2813 fn default() -> Self {
2814 Self::DEFAULT
2815 }
2816}
2817#[cfg_attr(feature = "ts", derive(TS))]
2818#[cfg_attr(feature = "ts", ts(export))]
2819#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2821#[cfg_attr(feature = "serde", serde(tag = "type"))]
2822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2823#[repr(u32)]
2824pub enum MavOdidClassEu {
2825 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2826 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2827 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2828 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2830 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2832 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2834 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2836 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2838 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2840 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2841}
2842impl MavOdidClassEu {
2843 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2844}
2845impl Default for MavOdidClassEu {
2846 fn default() -> Self {
2847 Self::DEFAULT
2848 }
2849}
2850#[cfg_attr(feature = "ts", derive(TS))]
2851#[cfg_attr(feature = "ts", ts(export))]
2852#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2854#[cfg_attr(feature = "serde", serde(tag = "type"))]
2855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2856#[repr(u32)]
2857pub enum MavOdidClassificationType {
2858 #[doc = "The classification type for the UA is undeclared."]
2859 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2860 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2861 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2862}
2863impl MavOdidClassificationType {
2864 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2865}
2866impl Default for MavOdidClassificationType {
2867 fn default() -> Self {
2868 Self::DEFAULT
2869 }
2870}
2871#[cfg_attr(feature = "ts", derive(TS))]
2872#[cfg_attr(feature = "ts", ts(export))]
2873#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2875#[cfg_attr(feature = "serde", serde(tag = "type"))]
2876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2877#[repr(u32)]
2878pub enum MavOdidDescType {
2879 #[doc = "Optional free-form text description of the purpose of the flight."]
2880 MAV_ODID_DESC_TYPE_TEXT = 0,
2881 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2882 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2883 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2885}
2886impl MavOdidDescType {
2887 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2888}
2889impl Default for MavOdidDescType {
2890 fn default() -> Self {
2891 Self::DEFAULT
2892 }
2893}
2894#[cfg_attr(feature = "ts", derive(TS))]
2895#[cfg_attr(feature = "ts", ts(export))]
2896#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2897#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2898#[cfg_attr(feature = "serde", serde(tag = "type"))]
2899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2900#[repr(u32)]
2901pub enum MavOdidHeightRef {
2902 #[doc = "The height field is relative to the take-off location."]
2903 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2904 #[doc = "The height field is relative to ground."]
2905 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2906}
2907impl MavOdidHeightRef {
2908 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2909}
2910impl Default for MavOdidHeightRef {
2911 fn default() -> Self {
2912 Self::DEFAULT
2913 }
2914}
2915#[cfg_attr(feature = "ts", derive(TS))]
2916#[cfg_attr(feature = "ts", ts(export))]
2917#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2919#[cfg_attr(feature = "serde", serde(tag = "type"))]
2920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2921#[repr(u32)]
2922pub enum MavOdidHorAcc {
2923 #[doc = "The horizontal accuracy is unknown."]
2924 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2925 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2926 MAV_ODID_HOR_ACC_10NM = 1,
2927 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2928 MAV_ODID_HOR_ACC_4NM = 2,
2929 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2930 MAV_ODID_HOR_ACC_2NM = 3,
2931 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2932 MAV_ODID_HOR_ACC_1NM = 4,
2933 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2934 MAV_ODID_HOR_ACC_0_5NM = 5,
2935 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2936 MAV_ODID_HOR_ACC_0_3NM = 6,
2937 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2938 MAV_ODID_HOR_ACC_0_1NM = 7,
2939 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2940 MAV_ODID_HOR_ACC_0_05NM = 8,
2941 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2942 MAV_ODID_HOR_ACC_30_METER = 9,
2943 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2944 MAV_ODID_HOR_ACC_10_METER = 10,
2945 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2946 MAV_ODID_HOR_ACC_3_METER = 11,
2947 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2948 MAV_ODID_HOR_ACC_1_METER = 12,
2949}
2950impl MavOdidHorAcc {
2951 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2952}
2953impl Default for MavOdidHorAcc {
2954 fn default() -> Self {
2955 Self::DEFAULT
2956 }
2957}
2958#[cfg_attr(feature = "ts", derive(TS))]
2959#[cfg_attr(feature = "ts", ts(export))]
2960#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2962#[cfg_attr(feature = "serde", serde(tag = "type"))]
2963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2964#[repr(u32)]
2965pub enum MavOdidIdType {
2966 #[doc = "No type defined."]
2967 MAV_ODID_ID_TYPE_NONE = 0,
2968 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2969 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2970 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2971 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2972 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2973 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2974 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2975 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2976}
2977impl MavOdidIdType {
2978 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2979}
2980impl Default for MavOdidIdType {
2981 fn default() -> Self {
2982 Self::DEFAULT
2983 }
2984}
2985#[cfg_attr(feature = "ts", derive(TS))]
2986#[cfg_attr(feature = "ts", ts(export))]
2987#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2989#[cfg_attr(feature = "serde", serde(tag = "type"))]
2990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2991#[repr(u32)]
2992pub enum MavOdidOperatorIdType {
2993 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2994 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2995}
2996impl MavOdidOperatorIdType {
2997 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2998}
2999impl Default for MavOdidOperatorIdType {
3000 fn default() -> Self {
3001 Self::DEFAULT
3002 }
3003}
3004#[cfg_attr(feature = "ts", derive(TS))]
3005#[cfg_attr(feature = "ts", ts(export))]
3006#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3008#[cfg_attr(feature = "serde", serde(tag = "type"))]
3009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3010#[repr(u32)]
3011pub enum MavOdidOperatorLocationType {
3012 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3013 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3014 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3016 #[doc = "The location/altitude of the operator are fixed values."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3018}
3019impl MavOdidOperatorLocationType {
3020 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3021}
3022impl Default for MavOdidOperatorLocationType {
3023 fn default() -> Self {
3024 Self::DEFAULT
3025 }
3026}
3027#[cfg_attr(feature = "ts", derive(TS))]
3028#[cfg_attr(feature = "ts", ts(export))]
3029#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3031#[cfg_attr(feature = "serde", serde(tag = "type"))]
3032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3033#[repr(u32)]
3034pub enum MavOdidSpeedAcc {
3035 #[doc = "The speed accuracy is unknown."]
3036 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3037 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3038 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3039 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3040 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3041 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3042 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3043 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3044 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3045}
3046impl MavOdidSpeedAcc {
3047 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3048}
3049impl Default for MavOdidSpeedAcc {
3050 fn default() -> Self {
3051 Self::DEFAULT
3052 }
3053}
3054#[cfg_attr(feature = "ts", derive(TS))]
3055#[cfg_attr(feature = "ts", ts(export))]
3056#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3058#[cfg_attr(feature = "serde", serde(tag = "type"))]
3059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3060#[repr(u32)]
3061pub enum MavOdidStatus {
3062 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3063 MAV_ODID_STATUS_UNDECLARED = 0,
3064 #[doc = "The UA is on the ground."]
3065 MAV_ODID_STATUS_GROUND = 1,
3066 #[doc = "The UA is in the air."]
3067 MAV_ODID_STATUS_AIRBORNE = 2,
3068 #[doc = "The UA is having an emergency."]
3069 MAV_ODID_STATUS_EMERGENCY = 3,
3070 #[doc = "The remote ID system is failing or unreliable in some way."]
3071 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3072}
3073impl MavOdidStatus {
3074 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3075}
3076impl Default for MavOdidStatus {
3077 fn default() -> Self {
3078 Self::DEFAULT
3079 }
3080}
3081#[cfg_attr(feature = "ts", derive(TS))]
3082#[cfg_attr(feature = "ts", ts(export))]
3083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3085#[cfg_attr(feature = "serde", serde(tag = "type"))]
3086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3087#[repr(u32)]
3088pub enum MavOdidTimeAcc {
3089 #[doc = "The timestamp accuracy is unknown."]
3090 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3091 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3092 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3094 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3096 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3098 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3100 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3102 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3104 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3106 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3108 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3110 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3112 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3114 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3116 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3118 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3120 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3121}
3122impl MavOdidTimeAcc {
3123 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3124}
3125impl Default for MavOdidTimeAcc {
3126 fn default() -> Self {
3127 Self::DEFAULT
3128 }
3129}
3130#[cfg_attr(feature = "ts", derive(TS))]
3131#[cfg_attr(feature = "ts", ts(export))]
3132#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3134#[cfg_attr(feature = "serde", serde(tag = "type"))]
3135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3136#[repr(u32)]
3137pub enum MavOdidUaType {
3138 #[doc = "No UA (Unmanned Aircraft) type defined."]
3139 MAV_ODID_UA_TYPE_NONE = 0,
3140 #[doc = "Aeroplane/Airplane. Fixed wing."]
3141 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3142 #[doc = "Helicopter or multirotor."]
3143 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3144 #[doc = "Gyroplane."]
3145 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3146 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3147 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3148 #[doc = "Ornithopter."]
3149 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3150 #[doc = "Glider."]
3151 MAV_ODID_UA_TYPE_GLIDER = 6,
3152 #[doc = "Kite."]
3153 MAV_ODID_UA_TYPE_KITE = 7,
3154 #[doc = "Free Balloon."]
3155 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3156 #[doc = "Captive Balloon."]
3157 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3158 #[doc = "Airship. E.g. a blimp."]
3159 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3160 #[doc = "Free Fall/Parachute (unpowered)."]
3161 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3162 #[doc = "Rocket."]
3163 MAV_ODID_UA_TYPE_ROCKET = 12,
3164 #[doc = "Tethered powered aircraft."]
3165 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3166 #[doc = "Ground Obstacle."]
3167 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3168 #[doc = "Other type of aircraft not listed earlier."]
3169 MAV_ODID_UA_TYPE_OTHER = 15,
3170}
3171impl MavOdidUaType {
3172 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3173}
3174impl Default for MavOdidUaType {
3175 fn default() -> Self {
3176 Self::DEFAULT
3177 }
3178}
3179#[cfg_attr(feature = "ts", derive(TS))]
3180#[cfg_attr(feature = "ts", ts(export))]
3181#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3183#[cfg_attr(feature = "serde", serde(tag = "type"))]
3184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3185#[repr(u32)]
3186pub enum MavOdidVerAcc {
3187 #[doc = "The vertical accuracy is unknown."]
3188 MAV_ODID_VER_ACC_UNKNOWN = 0,
3189 #[doc = "The vertical accuracy is smaller than 150 meter."]
3190 MAV_ODID_VER_ACC_150_METER = 1,
3191 #[doc = "The vertical accuracy is smaller than 45 meter."]
3192 MAV_ODID_VER_ACC_45_METER = 2,
3193 #[doc = "The vertical accuracy is smaller than 25 meter."]
3194 MAV_ODID_VER_ACC_25_METER = 3,
3195 #[doc = "The vertical accuracy is smaller than 10 meter."]
3196 MAV_ODID_VER_ACC_10_METER = 4,
3197 #[doc = "The vertical accuracy is smaller than 3 meter."]
3198 MAV_ODID_VER_ACC_3_METER = 5,
3199 #[doc = "The vertical accuracy is smaller than 1 meter."]
3200 MAV_ODID_VER_ACC_1_METER = 6,
3201}
3202impl MavOdidVerAcc {
3203 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3204}
3205impl Default for MavOdidVerAcc {
3206 fn default() -> Self {
3207 Self::DEFAULT
3208 }
3209}
3210#[cfg_attr(feature = "ts", derive(TS))]
3211#[cfg_attr(feature = "ts", ts(export))]
3212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3214#[cfg_attr(feature = "serde", serde(tag = "type"))]
3215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3216#[repr(u32)]
3217#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3218pub enum MavParamExtType {
3219 #[doc = "8-bit unsigned integer"]
3220 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3221 #[doc = "8-bit signed integer"]
3222 MAV_PARAM_EXT_TYPE_INT8 = 2,
3223 #[doc = "16-bit unsigned integer"]
3224 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3225 #[doc = "16-bit signed integer"]
3226 MAV_PARAM_EXT_TYPE_INT16 = 4,
3227 #[doc = "32-bit unsigned integer"]
3228 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3229 #[doc = "32-bit signed integer"]
3230 MAV_PARAM_EXT_TYPE_INT32 = 6,
3231 #[doc = "64-bit unsigned integer"]
3232 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3233 #[doc = "64-bit signed integer"]
3234 MAV_PARAM_EXT_TYPE_INT64 = 8,
3235 #[doc = "32-bit floating-point"]
3236 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3237 #[doc = "64-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3239 #[doc = "Custom Type"]
3240 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3241}
3242impl MavParamExtType {
3243 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3244}
3245impl Default for MavParamExtType {
3246 fn default() -> Self {
3247 Self::DEFAULT
3248 }
3249}
3250#[cfg_attr(feature = "ts", derive(TS))]
3251#[cfg_attr(feature = "ts", ts(export))]
3252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3254#[cfg_attr(feature = "serde", serde(tag = "type"))]
3255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3256#[repr(u32)]
3257#[doc = "Specifies the datatype of a MAVLink parameter."]
3258pub enum MavParamType {
3259 #[doc = "8-bit unsigned integer"]
3260 MAV_PARAM_TYPE_UINT8 = 1,
3261 #[doc = "8-bit signed integer"]
3262 MAV_PARAM_TYPE_INT8 = 2,
3263 #[doc = "16-bit unsigned integer"]
3264 MAV_PARAM_TYPE_UINT16 = 3,
3265 #[doc = "16-bit signed integer"]
3266 MAV_PARAM_TYPE_INT16 = 4,
3267 #[doc = "32-bit unsigned integer"]
3268 MAV_PARAM_TYPE_UINT32 = 5,
3269 #[doc = "32-bit signed integer"]
3270 MAV_PARAM_TYPE_INT32 = 6,
3271 #[doc = "64-bit unsigned integer"]
3272 MAV_PARAM_TYPE_UINT64 = 7,
3273 #[doc = "64-bit signed integer"]
3274 MAV_PARAM_TYPE_INT64 = 8,
3275 #[doc = "32-bit floating-point"]
3276 MAV_PARAM_TYPE_REAL32 = 9,
3277 #[doc = "64-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL64 = 10,
3279}
3280impl MavParamType {
3281 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3282}
3283impl Default for MavParamType {
3284 fn default() -> Self {
3285 Self::DEFAULT
3286 }
3287}
3288bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3289impl MavPowerStatus {
3290 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3291}
3292impl Default for MavPowerStatus {
3293 fn default() -> Self {
3294 Self::DEFAULT
3295 }
3296}
3297bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3298impl MavProtocolCapability {
3299 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3300}
3301impl Default for MavProtocolCapability {
3302 fn default() -> Self {
3303 Self::DEFAULT
3304 }
3305}
3306#[cfg_attr(feature = "ts", derive(TS))]
3307#[cfg_attr(feature = "ts", ts(export))]
3308#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3310#[cfg_attr(feature = "serde", serde(tag = "type"))]
3311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3312#[repr(u32)]
3313#[doc = "Result from a MAVLink command (MAV_CMD)"]
3314pub enum MavResult {
3315 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3316 MAV_RESULT_ACCEPTED = 0,
3317 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3318 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3319 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3320 MAV_RESULT_DENIED = 2,
3321 #[doc = "Command is not supported (unknown)."]
3322 MAV_RESULT_UNSUPPORTED = 3,
3323 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3324 MAV_RESULT_FAILED = 4,
3325 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3326 MAV_RESULT_IN_PROGRESS = 5,
3327 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3328 MAV_RESULT_CANCELLED = 6,
3329 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3330 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3331 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3332 MAV_RESULT_COMMAND_INT_ONLY = 8,
3333 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3334 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3335}
3336impl MavResult {
3337 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3338}
3339impl Default for MavResult {
3340 fn default() -> Self {
3341 Self::DEFAULT
3342 }
3343}
3344#[cfg_attr(feature = "ts", derive(TS))]
3345#[cfg_attr(feature = "ts", ts(export))]
3346#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3348#[cfg_attr(feature = "serde", serde(tag = "type"))]
3349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3350#[repr(u32)]
3351#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3352#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3353pub enum MavRoi {
3354 #[doc = "No region of interest."]
3355 MAV_ROI_NONE = 0,
3356 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3357 MAV_ROI_WPNEXT = 1,
3358 #[doc = "Point toward given waypoint."]
3359 MAV_ROI_WPINDEX = 2,
3360 #[doc = "Point toward fixed location."]
3361 MAV_ROI_LOCATION = 3,
3362 #[doc = "Point toward of given id."]
3363 MAV_ROI_TARGET = 4,
3364}
3365impl MavRoi {
3366 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3367}
3368impl Default for MavRoi {
3369 fn default() -> Self {
3370 Self::DEFAULT
3371 }
3372}
3373#[cfg_attr(feature = "ts", derive(TS))]
3374#[cfg_attr(feature = "ts", ts(export))]
3375#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3377#[cfg_attr(feature = "serde", serde(tag = "type"))]
3378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3379#[repr(u32)]
3380#[doc = "Enumeration of sensor orientation, according to its rotations"]
3381pub enum MavSensorOrientation {
3382 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3383 MAV_SENSOR_ROTATION_NONE = 0,
3384 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3385 MAV_SENSOR_ROTATION_YAW_45 = 1,
3386 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3387 MAV_SENSOR_ROTATION_YAW_90 = 2,
3388 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3389 MAV_SENSOR_ROTATION_YAW_135 = 3,
3390 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3391 MAV_SENSOR_ROTATION_YAW_180 = 4,
3392 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3393 MAV_SENSOR_ROTATION_YAW_225 = 5,
3394 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3395 MAV_SENSOR_ROTATION_YAW_270 = 6,
3396 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3397 MAV_SENSOR_ROTATION_YAW_315 = 7,
3398 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3399 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3400 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3401 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3402 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3403 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3404 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3405 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3406 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3407 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3408 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3409 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3410 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3411 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3412 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3413 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3414 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3415 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3416 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3417 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3418 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3419 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3420 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3421 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3422 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3423 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3424 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3425 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3426 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3427 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3428 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3429 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3430 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3431 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3432 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3434 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3435 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3436 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3437 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3438 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3439 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3440 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3442 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3443 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3444 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3445 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3446 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3447 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3448 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3450 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3451 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3452 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3453 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3454 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3455 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3456 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3457 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3458 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3459 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3460 #[doc = "Pitch: 315"]
3461 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3462 #[doc = "Roll: 90, Pitch: 315"]
3463 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3464 #[doc = "Custom orientation"]
3465 MAV_SENSOR_ROTATION_CUSTOM = 100,
3466}
3467impl MavSensorOrientation {
3468 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3469}
3470impl Default for MavSensorOrientation {
3471 fn default() -> Self {
3472 Self::DEFAULT
3473 }
3474}
3475#[cfg_attr(feature = "ts", derive(TS))]
3476#[cfg_attr(feature = "ts", ts(export))]
3477#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3479#[cfg_attr(feature = "serde", serde(tag = "type"))]
3480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3481#[repr(u32)]
3482#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3483pub enum MavSeverity {
3484 #[doc = "System is unusable. This is a \"panic\" condition."]
3485 MAV_SEVERITY_EMERGENCY = 0,
3486 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3487 MAV_SEVERITY_ALERT = 1,
3488 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3489 MAV_SEVERITY_CRITICAL = 2,
3490 #[doc = "Indicates an error in secondary/redundant systems."]
3491 MAV_SEVERITY_ERROR = 3,
3492 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3493 MAV_SEVERITY_WARNING = 4,
3494 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3495 MAV_SEVERITY_NOTICE = 5,
3496 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3497 MAV_SEVERITY_INFO = 6,
3498 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3499 MAV_SEVERITY_DEBUG = 7,
3500}
3501impl MavSeverity {
3502 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3503}
3504impl Default for MavSeverity {
3505 fn default() -> Self {
3506 Self::DEFAULT
3507 }
3508}
3509#[cfg_attr(feature = "ts", derive(TS))]
3510#[cfg_attr(feature = "ts", ts(export))]
3511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3513#[cfg_attr(feature = "serde", serde(tag = "type"))]
3514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3515#[repr(u32)]
3516#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3517pub enum MavStandardMode {
3518 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3519 MAV_STANDARD_MODE_NON_STANDARD = 0,
3520 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3521 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3522 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3523 MAV_STANDARD_MODE_ORBIT = 2,
3524 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3525 MAV_STANDARD_MODE_CRUISE = 3,
3526 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3527 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3528 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3529 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3530 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3531 MAV_STANDARD_MODE_MISSION = 6,
3532 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3533 MAV_STANDARD_MODE_LAND = 7,
3534 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3535 MAV_STANDARD_MODE_TAKEOFF = 8,
3536}
3537impl MavStandardMode {
3538 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3539}
3540impl Default for MavStandardMode {
3541 fn default() -> Self {
3542 Self::DEFAULT
3543 }
3544}
3545#[cfg_attr(feature = "ts", derive(TS))]
3546#[cfg_attr(feature = "ts", ts(export))]
3547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3549#[cfg_attr(feature = "serde", serde(tag = "type"))]
3550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3551#[repr(u32)]
3552pub enum MavState {
3553 #[doc = "Uninitialized system, state is unknown."]
3554 MAV_STATE_UNINIT = 0,
3555 #[doc = "System is booting up."]
3556 MAV_STATE_BOOT = 1,
3557 #[doc = "System is calibrating and not flight-ready."]
3558 MAV_STATE_CALIBRATING = 2,
3559 #[doc = "System is grounded and on standby. It can be launched any time."]
3560 MAV_STATE_STANDBY = 3,
3561 #[doc = "System is active and might be already airborne. Motors are engaged."]
3562 MAV_STATE_ACTIVE = 4,
3563 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3564 MAV_STATE_CRITICAL = 5,
3565 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3566 MAV_STATE_EMERGENCY = 6,
3567 #[doc = "System just initialized its power-down sequence, will shut down now."]
3568 MAV_STATE_POWEROFF = 7,
3569 #[doc = "System is terminating itself (failsafe or commanded)."]
3570 MAV_STATE_FLIGHT_TERMINATION = 8,
3571}
3572impl MavState {
3573 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3574}
3575impl Default for MavState {
3576 fn default() -> Self {
3577 Self::DEFAULT
3578 }
3579}
3580bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3581impl MavSysStatusSensor {
3582 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3583}
3584impl Default for MavSysStatusSensor {
3585 fn default() -> Self {
3586 Self::DEFAULT
3587 }
3588}
3589bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3590impl MavSysStatusSensorExtended {
3591 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3592}
3593impl Default for MavSysStatusSensorExtended {
3594 fn default() -> Self {
3595 Self::DEFAULT
3596 }
3597}
3598#[cfg_attr(feature = "ts", derive(TS))]
3599#[cfg_attr(feature = "ts", ts(export))]
3600#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3602#[cfg_attr(feature = "serde", serde(tag = "type"))]
3603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3604#[repr(u32)]
3605pub enum MavTunnelPayloadType {
3606 #[doc = "Encoding of payload unknown."]
3607 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3608 #[doc = "Registered for STorM32 gimbal controller."]
3609 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3610 #[doc = "Registered for STorM32 gimbal controller."]
3611 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3612 #[doc = "Registered for STorM32 gimbal controller."]
3613 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3614 #[doc = "Registered for STorM32 gimbal controller."]
3615 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3616 #[doc = "Registered for STorM32 gimbal controller."]
3617 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3618 #[doc = "Registered for STorM32 gimbal controller."]
3619 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3620 #[doc = "Registered for STorM32 gimbal controller."]
3621 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3622 #[doc = "Registered for STorM32 gimbal controller."]
3623 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3624 #[doc = "Registered for STorM32 gimbal controller."]
3625 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3626 #[doc = "Registered for STorM32 gimbal controller."]
3627 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3628 #[doc = "Registered for ModalAI remote OSD protocol."]
3629 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3630 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3631 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3632 #[doc = "Registered for ModalAI vendor use."]
3633 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3634}
3635impl MavTunnelPayloadType {
3636 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3637}
3638impl Default for MavTunnelPayloadType {
3639 fn default() -> Self {
3640 Self::DEFAULT
3641 }
3642}
3643#[cfg_attr(feature = "ts", derive(TS))]
3644#[cfg_attr(feature = "ts", ts(export))]
3645#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3647#[cfg_attr(feature = "serde", serde(tag = "type"))]
3648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3649#[repr(u32)]
3650#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3651pub enum MavType {
3652 #[doc = "Generic micro air vehicle"]
3653 MAV_TYPE_GENERIC = 0,
3654 #[doc = "Fixed wing aircraft."]
3655 MAV_TYPE_FIXED_WING = 1,
3656 #[doc = "Quadrotor"]
3657 MAV_TYPE_QUADROTOR = 2,
3658 #[doc = "Coaxial helicopter"]
3659 MAV_TYPE_COAXIAL = 3,
3660 #[doc = "Normal helicopter with tail rotor."]
3661 MAV_TYPE_HELICOPTER = 4,
3662 #[doc = "Ground installation"]
3663 MAV_TYPE_ANTENNA_TRACKER = 5,
3664 #[doc = "Operator control unit / ground control station"]
3665 MAV_TYPE_GCS = 6,
3666 #[doc = "Airship, controlled"]
3667 MAV_TYPE_AIRSHIP = 7,
3668 #[doc = "Free balloon, uncontrolled"]
3669 MAV_TYPE_FREE_BALLOON = 8,
3670 #[doc = "Rocket"]
3671 MAV_TYPE_ROCKET = 9,
3672 #[doc = "Ground rover"]
3673 MAV_TYPE_GROUND_ROVER = 10,
3674 #[doc = "Surface vessel, boat, ship"]
3675 MAV_TYPE_SURFACE_BOAT = 11,
3676 #[doc = "Submarine"]
3677 MAV_TYPE_SUBMARINE = 12,
3678 #[doc = "Hexarotor"]
3679 MAV_TYPE_HEXAROTOR = 13,
3680 #[doc = "Octorotor"]
3681 MAV_TYPE_OCTOROTOR = 14,
3682 #[doc = "Tricopter"]
3683 MAV_TYPE_TRICOPTER = 15,
3684 #[doc = "Flapping wing"]
3685 MAV_TYPE_FLAPPING_WING = 16,
3686 #[doc = "Kite"]
3687 MAV_TYPE_KITE = 17,
3688 #[doc = "Onboard companion controller"]
3689 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3690 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3691 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3692 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3693 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3694 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3695 MAV_TYPE_VTOL_TILTROTOR = 21,
3696 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3697 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3698 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3699 MAV_TYPE_VTOL_TAILSITTER = 23,
3700 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3701 MAV_TYPE_VTOL_TILTWING = 24,
3702 #[doc = "VTOL reserved 5"]
3703 MAV_TYPE_VTOL_RESERVED5 = 25,
3704 #[doc = "Gimbal"]
3705 MAV_TYPE_GIMBAL = 26,
3706 #[doc = "ADSB system"]
3707 MAV_TYPE_ADSB = 27,
3708 #[doc = "Steerable, nonrigid airfoil"]
3709 MAV_TYPE_PARAFOIL = 28,
3710 #[doc = "Dodecarotor"]
3711 MAV_TYPE_DODECAROTOR = 29,
3712 #[doc = "Camera"]
3713 MAV_TYPE_CAMERA = 30,
3714 #[doc = "Charging station"]
3715 MAV_TYPE_CHARGING_STATION = 31,
3716 #[doc = "FLARM collision avoidance system"]
3717 MAV_TYPE_FLARM = 32,
3718 #[doc = "Servo"]
3719 MAV_TYPE_SERVO = 33,
3720 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3721 MAV_TYPE_ODID = 34,
3722 #[doc = "Decarotor"]
3723 MAV_TYPE_DECAROTOR = 35,
3724 #[doc = "Battery"]
3725 MAV_TYPE_BATTERY = 36,
3726 #[doc = "Parachute"]
3727 MAV_TYPE_PARACHUTE = 37,
3728 #[doc = "Log"]
3729 MAV_TYPE_LOG = 38,
3730 #[doc = "OSD"]
3731 MAV_TYPE_OSD = 39,
3732 #[doc = "IMU"]
3733 MAV_TYPE_IMU = 40,
3734 #[doc = "GPS"]
3735 MAV_TYPE_GPS = 41,
3736 #[doc = "Winch"]
3737 MAV_TYPE_WINCH = 42,
3738 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3739 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3740 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3741 MAV_TYPE_ILLUMINATOR = 44,
3742 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3743 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3744}
3745impl MavType {
3746 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3747}
3748impl Default for MavType {
3749 fn default() -> Self {
3750 Self::DEFAULT
3751 }
3752}
3753#[cfg_attr(feature = "ts", derive(TS))]
3754#[cfg_attr(feature = "ts", ts(export))]
3755#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3757#[cfg_attr(feature = "serde", serde(tag = "type"))]
3758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3759#[repr(u32)]
3760#[doc = "Enumeration of VTOL states"]
3761pub enum MavVtolState {
3762 #[doc = "MAV is not configured as VTOL"]
3763 MAV_VTOL_STATE_UNDEFINED = 0,
3764 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3765 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3766 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3767 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3768 #[doc = "VTOL is in multicopter state"]
3769 MAV_VTOL_STATE_MC = 3,
3770 #[doc = "VTOL is in fixed-wing state"]
3771 MAV_VTOL_STATE_FW = 4,
3772}
3773impl MavVtolState {
3774 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3775}
3776impl Default for MavVtolState {
3777 fn default() -> Self {
3778 Self::DEFAULT
3779 }
3780}
3781bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3782impl MavWinchStatusFlag {
3783 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3784}
3785impl Default for MavWinchStatusFlag {
3786 fn default() -> Self {
3787 Self::DEFAULT
3788 }
3789}
3790#[cfg_attr(feature = "ts", derive(TS))]
3791#[cfg_attr(feature = "ts", ts(export))]
3792#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3794#[cfg_attr(feature = "serde", serde(tag = "type"))]
3795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3796#[repr(u32)]
3797pub enum MavlinkDataStreamType {
3798 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3799 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3800 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3801 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3802 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3803 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3804}
3805impl MavlinkDataStreamType {
3806 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3807}
3808impl Default for MavlinkDataStreamType {
3809 fn default() -> Self {
3810 Self::DEFAULT
3811 }
3812}
3813#[cfg_attr(feature = "ts", derive(TS))]
3814#[cfg_attr(feature = "ts", ts(export))]
3815#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3817#[cfg_attr(feature = "serde", serde(tag = "type"))]
3818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3819#[repr(u32)]
3820#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3821pub enum MissionState {
3822 #[doc = "The mission status reporting is not supported."]
3823 MISSION_STATE_UNKNOWN = 0,
3824 #[doc = "No mission on the vehicle."]
3825 MISSION_STATE_NO_MISSION = 1,
3826 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3827 MISSION_STATE_NOT_STARTED = 2,
3828 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3829 MISSION_STATE_ACTIVE = 3,
3830 #[doc = "Mission is paused when in auto mode."]
3831 MISSION_STATE_PAUSED = 4,
3832 #[doc = "Mission has executed all mission items."]
3833 MISSION_STATE_COMPLETE = 5,
3834}
3835impl MissionState {
3836 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3837}
3838impl Default for MissionState {
3839 fn default() -> Self {
3840 Self::DEFAULT
3841 }
3842}
3843#[cfg_attr(feature = "ts", derive(TS))]
3844#[cfg_attr(feature = "ts", ts(export))]
3845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3847#[cfg_attr(feature = "serde", serde(tag = "type"))]
3848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3849#[repr(u32)]
3850#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3851pub enum MotorTestOrder {
3852 #[doc = "Default autopilot motor test method."]
3853 MOTOR_TEST_ORDER_DEFAULT = 0,
3854 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3855 MOTOR_TEST_ORDER_SEQUENCE = 1,
3856 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3857 MOTOR_TEST_ORDER_BOARD = 2,
3858}
3859impl MotorTestOrder {
3860 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3861}
3862impl Default for MotorTestOrder {
3863 fn default() -> Self {
3864 Self::DEFAULT
3865 }
3866}
3867#[cfg_attr(feature = "ts", derive(TS))]
3868#[cfg_attr(feature = "ts", ts(export))]
3869#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3871#[cfg_attr(feature = "serde", serde(tag = "type"))]
3872#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3873#[repr(u32)]
3874#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3875pub enum MotorTestThrottleType {
3876 #[doc = "Throttle as a percentage (0 ~ 100)"]
3877 MOTOR_TEST_THROTTLE_PERCENT = 0,
3878 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3879 MOTOR_TEST_THROTTLE_PWM = 1,
3880 #[doc = "Throttle pass-through from pilot's transmitter."]
3881 MOTOR_TEST_THROTTLE_PILOT = 2,
3882 #[doc = "Per-motor compass calibration test."]
3883 MOTOR_TEST_COMPASS_CAL = 3,
3884}
3885impl MotorTestThrottleType {
3886 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3887}
3888impl Default for MotorTestThrottleType {
3889 fn default() -> Self {
3890 Self::DEFAULT
3891 }
3892}
3893#[cfg_attr(feature = "ts", derive(TS))]
3894#[cfg_attr(feature = "ts", ts(export))]
3895#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3897#[cfg_attr(feature = "serde", serde(tag = "type"))]
3898#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3899#[repr(u32)]
3900pub enum NavVtolLandOptions {
3901 #[doc = "Default autopilot landing behaviour."]
3902 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3903 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3904 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3905 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3906 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3907}
3908impl NavVtolLandOptions {
3909 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3910}
3911impl Default for NavVtolLandOptions {
3912 fn default() -> Self {
3913 Self::DEFAULT
3914 }
3915}
3916#[cfg_attr(feature = "ts", derive(TS))]
3917#[cfg_attr(feature = "ts", ts(export))]
3918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3920#[cfg_attr(feature = "serde", serde(tag = "type"))]
3921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3922#[repr(u32)]
3923#[doc = "Yaw behaviour during orbit flight."]
3924pub enum OrbitYawBehaviour {
3925 #[doc = "Vehicle front points to the center (default)."]
3926 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3927 #[doc = "Vehicle front holds heading when message received."]
3928 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3929 #[doc = "Yaw uncontrolled."]
3930 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3931 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3932 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3933 #[doc = "Yaw controlled by RC input."]
3934 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3935 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3936 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3937}
3938impl OrbitYawBehaviour {
3939 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3940}
3941impl Default for OrbitYawBehaviour {
3942 fn default() -> Self {
3943 Self::DEFAULT
3944 }
3945}
3946#[cfg_attr(feature = "ts", derive(TS))]
3947#[cfg_attr(feature = "ts", ts(export))]
3948#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3950#[cfg_attr(feature = "serde", serde(tag = "type"))]
3951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3952#[repr(u32)]
3953#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3954pub enum ParachuteAction {
3955 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3956 PARACHUTE_DISABLE = 0,
3957 #[doc = "Enable auto-release of parachute."]
3958 PARACHUTE_ENABLE = 1,
3959 #[doc = "Release parachute and kill motors."]
3960 PARACHUTE_RELEASE = 2,
3961}
3962impl ParachuteAction {
3963 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3964}
3965impl Default for ParachuteAction {
3966 fn default() -> Self {
3967 Self::DEFAULT
3968 }
3969}
3970#[cfg_attr(feature = "ts", derive(TS))]
3971#[cfg_attr(feature = "ts", ts(export))]
3972#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3973#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3974#[cfg_attr(feature = "serde", serde(tag = "type"))]
3975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3976#[repr(u32)]
3977#[doc = "Result from PARAM_EXT_SET message."]
3978pub enum ParamAck {
3979 #[doc = "Parameter value ACCEPTED and SET"]
3980 PARAM_ACK_ACCEPTED = 0,
3981 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3982 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3983 #[doc = "Parameter failed to set"]
3984 PARAM_ACK_FAILED = 2,
3985 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3986 PARAM_ACK_IN_PROGRESS = 3,
3987}
3988impl ParamAck {
3989 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3990}
3991impl Default for ParamAck {
3992 fn default() -> Self {
3993 Self::DEFAULT
3994 }
3995}
3996bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3997impl PositionTargetTypemask {
3998 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3999}
4000impl Default for PositionTargetTypemask {
4001 fn default() -> Self {
4002 Self::DEFAULT
4003 }
4004}
4005#[cfg_attr(feature = "ts", derive(TS))]
4006#[cfg_attr(feature = "ts", ts(export))]
4007#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4008#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4009#[cfg_attr(feature = "serde", serde(tag = "type"))]
4010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4011#[repr(u32)]
4012#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4013pub enum PrecisionLandMode {
4014 #[doc = "Normal (non-precision) landing."]
4015 PRECISION_LAND_MODE_DISABLED = 0,
4016 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4017 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4018 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4019 PRECISION_LAND_MODE_REQUIRED = 2,
4020}
4021impl PrecisionLandMode {
4022 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4023}
4024impl Default for PrecisionLandMode {
4025 fn default() -> Self {
4026 Self::DEFAULT
4027 }
4028}
4029#[cfg_attr(feature = "ts", derive(TS))]
4030#[cfg_attr(feature = "ts", ts(export))]
4031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4033#[cfg_attr(feature = "serde", serde(tag = "type"))]
4034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4035#[repr(u32)]
4036#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4037pub enum PreflightStorageMissionAction {
4038 #[doc = "Read current mission data from persistent storage"]
4039 MISSION_READ_PERSISTENT = 0,
4040 #[doc = "Write current mission data to persistent storage"]
4041 MISSION_WRITE_PERSISTENT = 1,
4042 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4043 MISSION_RESET_DEFAULT = 2,
4044}
4045impl PreflightStorageMissionAction {
4046 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4047}
4048impl Default for PreflightStorageMissionAction {
4049 fn default() -> Self {
4050 Self::DEFAULT
4051 }
4052}
4053#[cfg_attr(feature = "ts", derive(TS))]
4054#[cfg_attr(feature = "ts", ts(export))]
4055#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4056#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4057#[cfg_attr(feature = "serde", serde(tag = "type"))]
4058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4059#[repr(u32)]
4060#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4061pub enum PreflightStorageParameterAction {
4062 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4063 PARAM_READ_PERSISTENT = 0,
4064 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4065 PARAM_WRITE_PERSISTENT = 1,
4066 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4067 PARAM_RESET_CONFIG_DEFAULT = 2,
4068 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4069 PARAM_RESET_SENSOR_DEFAULT = 3,
4070 #[doc = "Reset all parameters, including operation counters, to default values"]
4071 PARAM_RESET_ALL_DEFAULT = 4,
4072}
4073impl PreflightStorageParameterAction {
4074 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4075}
4076impl Default for PreflightStorageParameterAction {
4077 fn default() -> Self {
4078 Self::DEFAULT
4079 }
4080}
4081#[cfg_attr(feature = "ts", derive(TS))]
4082#[cfg_attr(feature = "ts", ts(export))]
4083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4085#[cfg_attr(feature = "serde", serde(tag = "type"))]
4086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4087#[repr(u32)]
4088#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4089pub enum RcSubType {
4090 #[doc = "Spektrum DSM2"]
4091 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4092 #[doc = "Spektrum DSMX"]
4093 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4094 #[doc = "Spektrum DSMX8"]
4095 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4096}
4097impl RcSubType {
4098 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4099}
4100impl Default for RcSubType {
4101 fn default() -> Self {
4102 Self::DEFAULT
4103 }
4104}
4105#[cfg_attr(feature = "ts", derive(TS))]
4106#[cfg_attr(feature = "ts", ts(export))]
4107#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4109#[cfg_attr(feature = "serde", serde(tag = "type"))]
4110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4111#[repr(u32)]
4112#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4113pub enum RcType {
4114 #[doc = "Spektrum"]
4115 RC_TYPE_SPEKTRUM = 0,
4116 #[doc = "CRSF"]
4117 RC_TYPE_CRSF = 1,
4118}
4119impl RcType {
4120 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4121}
4122impl Default for RcType {
4123 fn default() -> Self {
4124 Self::DEFAULT
4125 }
4126}
4127#[cfg_attr(feature = "ts", derive(TS))]
4128#[cfg_attr(feature = "ts", ts(export))]
4129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4131#[cfg_attr(feature = "serde", serde(tag = "type"))]
4132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4133#[repr(u32)]
4134#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4135pub enum RebootShutdownConditions {
4136 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4137 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4138 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4139 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4140}
4141impl RebootShutdownConditions {
4142 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4143}
4144impl Default for RebootShutdownConditions {
4145 fn default() -> Self {
4146 Self::DEFAULT
4147 }
4148}
4149#[cfg_attr(feature = "ts", derive(TS))]
4150#[cfg_attr(feature = "ts", ts(export))]
4151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4153#[cfg_attr(feature = "serde", serde(tag = "type"))]
4154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4155#[repr(u32)]
4156#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4157pub enum RtkBaselineCoordinateSystem {
4158 #[doc = "Earth-centered, Earth-fixed"]
4159 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4160 #[doc = "RTK basestation centered, north, east, down"]
4161 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4162}
4163impl RtkBaselineCoordinateSystem {
4164 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4165}
4166impl Default for RtkBaselineCoordinateSystem {
4167 fn default() -> Self {
4168 Self::DEFAULT
4169 }
4170}
4171#[cfg_attr(feature = "ts", derive(TS))]
4172#[cfg_attr(feature = "ts", ts(export))]
4173#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4175#[cfg_attr(feature = "serde", serde(tag = "type"))]
4176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4177#[repr(u32)]
4178#[doc = "Possible safety switch states."]
4179pub enum SafetySwitchState {
4180 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4181 SAFETY_SWITCH_STATE_SAFE = 0,
4182 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4183 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4184}
4185impl SafetySwitchState {
4186 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4187}
4188impl Default for SafetySwitchState {
4189 fn default() -> Self {
4190 Self::DEFAULT
4191 }
4192}
4193#[cfg_attr(feature = "ts", derive(TS))]
4194#[cfg_attr(feature = "ts", ts(export))]
4195#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4197#[cfg_attr(feature = "serde", serde(tag = "type"))]
4198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4199#[repr(u32)]
4200#[doc = "SERIAL_CONTROL device types"]
4201pub enum SerialControlDev {
4202 #[doc = "First telemetry port"]
4203 SERIAL_CONTROL_DEV_TELEM1 = 0,
4204 #[doc = "Second telemetry port"]
4205 SERIAL_CONTROL_DEV_TELEM2 = 1,
4206 #[doc = "First GPS port"]
4207 SERIAL_CONTROL_DEV_GPS1 = 2,
4208 #[doc = "Second GPS port"]
4209 SERIAL_CONTROL_DEV_GPS2 = 3,
4210 #[doc = "system shell"]
4211 SERIAL_CONTROL_DEV_SHELL = 10,
4212 #[doc = "SERIAL0"]
4213 SERIAL_CONTROL_SERIAL0 = 100,
4214 #[doc = "SERIAL1"]
4215 SERIAL_CONTROL_SERIAL1 = 101,
4216 #[doc = "SERIAL2"]
4217 SERIAL_CONTROL_SERIAL2 = 102,
4218 #[doc = "SERIAL3"]
4219 SERIAL_CONTROL_SERIAL3 = 103,
4220 #[doc = "SERIAL4"]
4221 SERIAL_CONTROL_SERIAL4 = 104,
4222 #[doc = "SERIAL5"]
4223 SERIAL_CONTROL_SERIAL5 = 105,
4224 #[doc = "SERIAL6"]
4225 SERIAL_CONTROL_SERIAL6 = 106,
4226 #[doc = "SERIAL7"]
4227 SERIAL_CONTROL_SERIAL7 = 107,
4228 #[doc = "SERIAL8"]
4229 SERIAL_CONTROL_SERIAL8 = 108,
4230 #[doc = "SERIAL9"]
4231 SERIAL_CONTROL_SERIAL9 = 109,
4232}
4233impl SerialControlDev {
4234 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4235}
4236impl Default for SerialControlDev {
4237 fn default() -> Self {
4238 Self::DEFAULT
4239 }
4240}
4241bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4242impl SerialControlFlag {
4243 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4244}
4245impl Default for SerialControlFlag {
4246 fn default() -> Self {
4247 Self::DEFAULT
4248 }
4249}
4250#[cfg_attr(feature = "ts", derive(TS))]
4251#[cfg_attr(feature = "ts", ts(export))]
4252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4254#[cfg_attr(feature = "serde", serde(tag = "type"))]
4255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4256#[repr(u32)]
4257#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4258pub enum SetFocusType {
4259 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4260 FOCUS_TYPE_STEP = 0,
4261 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4262 FOCUS_TYPE_CONTINUOUS = 1,
4263 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4264 FOCUS_TYPE_RANGE = 2,
4265 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4266 FOCUS_TYPE_METERS = 3,
4267 #[doc = "Focus automatically."]
4268 FOCUS_TYPE_AUTO = 4,
4269 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4270 FOCUS_TYPE_AUTO_SINGLE = 5,
4271 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4272 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4273}
4274impl SetFocusType {
4275 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4276}
4277impl Default for SetFocusType {
4278 fn default() -> Self {
4279 Self::DEFAULT
4280 }
4281}
4282#[cfg_attr(feature = "ts", derive(TS))]
4283#[cfg_attr(feature = "ts", ts(export))]
4284#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4286#[cfg_attr(feature = "serde", serde(tag = "type"))]
4287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4288#[repr(u32)]
4289#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4290pub enum SpeedType {
4291 #[doc = "Airspeed"]
4292 SPEED_TYPE_AIRSPEED = 0,
4293 #[doc = "Groundspeed"]
4294 SPEED_TYPE_GROUNDSPEED = 1,
4295 #[doc = "Climb speed"]
4296 SPEED_TYPE_CLIMB_SPEED = 2,
4297 #[doc = "Descent speed"]
4298 SPEED_TYPE_DESCENT_SPEED = 3,
4299}
4300impl SpeedType {
4301 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4302}
4303impl Default for SpeedType {
4304 fn default() -> Self {
4305 Self::DEFAULT
4306 }
4307}
4308#[cfg_attr(feature = "ts", derive(TS))]
4309#[cfg_attr(feature = "ts", ts(export))]
4310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4312#[cfg_attr(feature = "serde", serde(tag = "type"))]
4313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4314#[repr(u32)]
4315#[doc = "Flags to indicate the status of camera storage."]
4316pub enum StorageStatus {
4317 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4318 STORAGE_STATUS_EMPTY = 0,
4319 #[doc = "Storage present but unformatted."]
4320 STORAGE_STATUS_UNFORMATTED = 1,
4321 #[doc = "Storage present and ready."]
4322 STORAGE_STATUS_READY = 2,
4323 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4324 STORAGE_STATUS_NOT_SUPPORTED = 3,
4325}
4326impl StorageStatus {
4327 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4328}
4329impl Default for StorageStatus {
4330 fn default() -> Self {
4331 Self::DEFAULT
4332 }
4333}
4334#[cfg_attr(feature = "ts", derive(TS))]
4335#[cfg_attr(feature = "ts", ts(export))]
4336#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4338#[cfg_attr(feature = "serde", serde(tag = "type"))]
4339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4340#[repr(u32)]
4341#[doc = "Flags to indicate the type of storage."]
4342pub enum StorageType {
4343 #[doc = "Storage type is not known."]
4344 STORAGE_TYPE_UNKNOWN = 0,
4345 #[doc = "Storage type is USB device."]
4346 STORAGE_TYPE_USB_STICK = 1,
4347 #[doc = "Storage type is SD card."]
4348 STORAGE_TYPE_SD = 2,
4349 #[doc = "Storage type is microSD card."]
4350 STORAGE_TYPE_MICROSD = 3,
4351 #[doc = "Storage type is CFast."]
4352 STORAGE_TYPE_CF = 4,
4353 #[doc = "Storage type is CFexpress."]
4354 STORAGE_TYPE_CFE = 5,
4355 #[doc = "Storage type is XQD."]
4356 STORAGE_TYPE_XQD = 6,
4357 #[doc = "Storage type is HD mass storage type."]
4358 STORAGE_TYPE_HD = 7,
4359 #[doc = "Storage type is other, not listed type."]
4360 STORAGE_TYPE_OTHER = 254,
4361}
4362impl StorageType {
4363 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4364}
4365impl Default for StorageType {
4366 fn default() -> Self {
4367 Self::DEFAULT
4368 }
4369}
4370bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4371impl StorageUsageFlag {
4372 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4373}
4374impl Default for StorageUsageFlag {
4375 fn default() -> Self {
4376 Self::DEFAULT
4377 }
4378}
4379#[cfg_attr(feature = "ts", derive(TS))]
4380#[cfg_attr(feature = "ts", ts(export))]
4381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4383#[cfg_attr(feature = "serde", serde(tag = "type"))]
4384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4385#[repr(u32)]
4386#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4387pub enum TuneFormat {
4388 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4389 TUNE_FORMAT_QBASIC1_1 = 1,
4390 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4391 TUNE_FORMAT_MML_MODERN = 2,
4392}
4393impl TuneFormat {
4394 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4395}
4396impl Default for TuneFormat {
4397 fn default() -> Self {
4398 Self::DEFAULT
4399 }
4400}
4401#[cfg_attr(feature = "ts", derive(TS))]
4402#[cfg_attr(feature = "ts", ts(export))]
4403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4405#[cfg_attr(feature = "serde", serde(tag = "type"))]
4406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4407#[repr(u32)]
4408#[doc = "Generalized UAVCAN node health"]
4409pub enum UavcanNodeHealth {
4410 #[doc = "The node is functioning properly."]
4411 UAVCAN_NODE_HEALTH_OK = 0,
4412 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4413 UAVCAN_NODE_HEALTH_WARNING = 1,
4414 #[doc = "The node has encountered a major failure."]
4415 UAVCAN_NODE_HEALTH_ERROR = 2,
4416 #[doc = "The node has suffered a fatal malfunction."]
4417 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4418}
4419impl UavcanNodeHealth {
4420 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4421}
4422impl Default for UavcanNodeHealth {
4423 fn default() -> Self {
4424 Self::DEFAULT
4425 }
4426}
4427#[cfg_attr(feature = "ts", derive(TS))]
4428#[cfg_attr(feature = "ts", ts(export))]
4429#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4431#[cfg_attr(feature = "serde", serde(tag = "type"))]
4432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4433#[repr(u32)]
4434#[doc = "Generalized UAVCAN node mode"]
4435pub enum UavcanNodeMode {
4436 #[doc = "The node is performing its primary functions."]
4437 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4438 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4439 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4440 #[doc = "The node is under maintenance."]
4441 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4442 #[doc = "The node is in the process of updating its software."]
4443 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4444 #[doc = "The node is no longer available online."]
4445 UAVCAN_NODE_MODE_OFFLINE = 7,
4446}
4447impl UavcanNodeMode {
4448 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4449}
4450impl Default for UavcanNodeMode {
4451 fn default() -> Self {
4452 Self::DEFAULT
4453 }
4454}
4455bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4456impl UtmDataAvailFlags {
4457 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4458}
4459impl Default for UtmDataAvailFlags {
4460 fn default() -> Self {
4461 Self::DEFAULT
4462 }
4463}
4464#[cfg_attr(feature = "ts", derive(TS))]
4465#[cfg_attr(feature = "ts", ts(export))]
4466#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4467#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4468#[cfg_attr(feature = "serde", serde(tag = "type"))]
4469#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4470#[repr(u32)]
4471#[doc = "Airborne status of UAS."]
4472pub enum UtmFlightState {
4473 #[doc = "The flight state can't be determined."]
4474 UTM_FLIGHT_STATE_UNKNOWN = 1,
4475 #[doc = "UAS on ground."]
4476 UTM_FLIGHT_STATE_GROUND = 2,
4477 #[doc = "UAS airborne."]
4478 UTM_FLIGHT_STATE_AIRBORNE = 3,
4479 #[doc = "UAS is in an emergency flight state."]
4480 UTM_FLIGHT_STATE_EMERGENCY = 16,
4481 #[doc = "UAS has no active controls."]
4482 UTM_FLIGHT_STATE_NOCTRL = 32,
4483}
4484impl UtmFlightState {
4485 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4486}
4487impl Default for UtmFlightState {
4488 fn default() -> Self {
4489 Self::DEFAULT
4490 }
4491}
4492#[cfg_attr(feature = "ts", derive(TS))]
4493#[cfg_attr(feature = "ts", ts(export))]
4494#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4496#[cfg_attr(feature = "serde", serde(tag = "type"))]
4497#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4498#[repr(u32)]
4499#[doc = "Video stream encodings"]
4500pub enum VideoStreamEncoding {
4501 #[doc = "Stream encoding is unknown"]
4502 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4503 #[doc = "Stream encoding is H.264"]
4504 VIDEO_STREAM_ENCODING_H264 = 1,
4505 #[doc = "Stream encoding is H.265"]
4506 VIDEO_STREAM_ENCODING_H265 = 2,
4507}
4508impl VideoStreamEncoding {
4509 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4510}
4511impl Default for VideoStreamEncoding {
4512 fn default() -> Self {
4513 Self::DEFAULT
4514 }
4515}
4516bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4517impl VideoStreamStatusFlags {
4518 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4519}
4520impl Default for VideoStreamStatusFlags {
4521 fn default() -> Self {
4522 Self::DEFAULT
4523 }
4524}
4525#[cfg_attr(feature = "ts", derive(TS))]
4526#[cfg_attr(feature = "ts", ts(export))]
4527#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4528#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4529#[cfg_attr(feature = "serde", serde(tag = "type"))]
4530#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4531#[repr(u32)]
4532#[doc = "Video stream types"]
4533pub enum VideoStreamType {
4534 #[doc = "Stream is RTSP"]
4535 VIDEO_STREAM_TYPE_RTSP = 0,
4536 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4537 VIDEO_STREAM_TYPE_RTPUDP = 1,
4538 #[doc = "Stream is MPEG on TCP"]
4539 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4540 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4541 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4542}
4543impl VideoStreamType {
4544 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4545}
4546impl Default for VideoStreamType {
4547 fn default() -> Self {
4548 Self::DEFAULT
4549 }
4550}
4551#[cfg_attr(feature = "ts", derive(TS))]
4552#[cfg_attr(feature = "ts", ts(export))]
4553#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4554#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4555#[cfg_attr(feature = "serde", serde(tag = "type"))]
4556#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4557#[repr(u32)]
4558#[doc = "Direction of VTOL transition"]
4559pub enum VtolTransitionHeading {
4560 #[doc = "Respect the heading configuration of the vehicle."]
4561 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4562 #[doc = "Use the heading pointing towards the next waypoint."]
4563 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4564 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4565 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4566 #[doc = "Use the specified heading in parameter 4."]
4567 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4568 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4569 VTOL_TRANSITION_HEADING_ANY = 4,
4570}
4571impl VtolTransitionHeading {
4572 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4573}
4574impl Default for VtolTransitionHeading {
4575 fn default() -> Self {
4576 Self::DEFAULT
4577 }
4578}
4579#[cfg_attr(feature = "ts", derive(TS))]
4580#[cfg_attr(feature = "ts", ts(export))]
4581#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4583#[cfg_attr(feature = "serde", serde(tag = "type"))]
4584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4585#[repr(u32)]
4586#[doc = "WiFi Mode."]
4587pub enum WifiConfigApMode {
4588 #[doc = "WiFi mode is undefined."]
4589 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4590 #[doc = "WiFi configured as an access point."]
4591 WIFI_CONFIG_AP_MODE_AP = 1,
4592 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4593 WIFI_CONFIG_AP_MODE_STATION = 2,
4594 #[doc = "WiFi disabled."]
4595 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4596}
4597impl WifiConfigApMode {
4598 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4599}
4600impl Default for WifiConfigApMode {
4601 fn default() -> Self {
4602 Self::DEFAULT
4603 }
4604}
4605#[cfg_attr(feature = "ts", derive(TS))]
4606#[cfg_attr(feature = "ts", ts(export))]
4607#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4609#[cfg_attr(feature = "serde", serde(tag = "type"))]
4610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4611#[repr(u32)]
4612#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4613pub enum WifiConfigApResponse {
4614 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4615 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4616 #[doc = "Changes accepted."]
4617 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4618 #[doc = "Changes rejected."]
4619 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4620 #[doc = "Invalid Mode."]
4621 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4622 #[doc = "Invalid SSID."]
4623 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4624 #[doc = "Invalid Password."]
4625 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4626}
4627impl WifiConfigApResponse {
4628 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4629}
4630impl Default for WifiConfigApResponse {
4631 fn default() -> Self {
4632 Self::DEFAULT
4633 }
4634}
4635#[cfg_attr(feature = "ts", derive(TS))]
4636#[cfg_attr(feature = "ts", ts(export))]
4637#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4639#[cfg_attr(feature = "serde", serde(tag = "type"))]
4640#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4641#[repr(u32)]
4642#[doc = "Winch actions."]
4643pub enum WinchActions {
4644 #[doc = "Allow motor to freewheel."]
4645 WINCH_RELAXED = 0,
4646 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4647 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4648 #[doc = "Wind or unwind line at specified rate."]
4649 WINCH_RATE_CONTROL = 2,
4650 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4651 WINCH_LOCK = 3,
4652 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4653 WINCH_DELIVER = 4,
4654 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4655 WINCH_HOLD = 5,
4656 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4657 WINCH_RETRACT = 6,
4658 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4659 WINCH_LOAD_LINE = 7,
4660 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4661 WINCH_ABANDON_LINE = 8,
4662 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4663 WINCH_LOAD_PAYLOAD = 9,
4664}
4665impl WinchActions {
4666 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4667}
4668impl Default for WinchActions {
4669 fn default() -> Self {
4670 Self::DEFAULT
4671 }
4672}
4673#[doc = "Set the vehicle attitude and body angular rates."]
4674#[doc = ""]
4675#[doc = "ID: 140"]
4676#[derive(Debug, Clone, PartialEq)]
4677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4679#[cfg_attr(feature = "ts", derive(TS))]
4680#[cfg_attr(feature = "ts", ts(export))]
4681pub struct ACTUATOR_CONTROL_TARGET_DATA {
4682 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4683 pub time_usec: u64,
4684 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4685 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4686 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4687 pub controls: [f32; 8],
4688 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4689 pub group_mlx: u8,
4690}
4691impl ACTUATOR_CONTROL_TARGET_DATA {
4692 pub const ENCODED_LEN: usize = 41usize;
4693 pub const DEFAULT: Self = Self {
4694 time_usec: 0_u64,
4695 controls: [0.0_f32; 8usize],
4696 group_mlx: 0_u8,
4697 };
4698 #[cfg(feature = "arbitrary")]
4699 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4700 use arbitrary::{Arbitrary, Unstructured};
4701 let mut buf = [0u8; 1024];
4702 rng.fill_bytes(&mut buf);
4703 let mut unstructured = Unstructured::new(&buf);
4704 Self::arbitrary(&mut unstructured).unwrap_or_default()
4705 }
4706}
4707impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4708 fn default() -> Self {
4709 Self::DEFAULT.clone()
4710 }
4711}
4712impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4713 type Message = MavMessage;
4714 const ID: u32 = 140u32;
4715 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4716 const EXTRA_CRC: u8 = 181u8;
4717 const ENCODED_LEN: usize = 41usize;
4718 fn deser(
4719 _version: MavlinkVersion,
4720 __input: &[u8],
4721 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4722 let avail_len = __input.len();
4723 let mut payload_buf = [0; Self::ENCODED_LEN];
4724 let mut buf = if avail_len < Self::ENCODED_LEN {
4725 payload_buf[0..avail_len].copy_from_slice(__input);
4726 Bytes::new(&payload_buf)
4727 } else {
4728 Bytes::new(__input)
4729 };
4730 let mut __struct = Self::default();
4731 __struct.time_usec = buf.get_u64_le();
4732 for v in &mut __struct.controls {
4733 let val = buf.get_f32_le();
4734 *v = val;
4735 }
4736 __struct.group_mlx = buf.get_u8();
4737 Ok(__struct)
4738 }
4739 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4740 let mut __tmp = BytesMut::new(bytes);
4741 #[allow(clippy::absurd_extreme_comparisons)]
4742 #[allow(unused_comparisons)]
4743 if __tmp.remaining() < Self::ENCODED_LEN {
4744 panic!(
4745 "buffer is too small (need {} bytes, but got {})",
4746 Self::ENCODED_LEN,
4747 __tmp.remaining(),
4748 )
4749 }
4750 __tmp.put_u64_le(self.time_usec);
4751 for val in &self.controls {
4752 __tmp.put_f32_le(*val);
4753 }
4754 __tmp.put_u8(self.group_mlx);
4755 if matches!(version, MavlinkVersion::V2) {
4756 let len = __tmp.len();
4757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4758 } else {
4759 __tmp.len()
4760 }
4761 }
4762}
4763#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4764#[doc = ""]
4765#[doc = "ID: 375"]
4766#[derive(Debug, Clone, PartialEq)]
4767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4769#[cfg_attr(feature = "ts", derive(TS))]
4770#[cfg_attr(feature = "ts", ts(export))]
4771pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4772 #[doc = "Timestamp (since system boot)."]
4773 pub time_usec: u64,
4774 #[doc = "Active outputs"]
4775 pub active: u32,
4776 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4777 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4778 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4779 pub actuator: [f32; 32],
4780}
4781impl ACTUATOR_OUTPUT_STATUS_DATA {
4782 pub const ENCODED_LEN: usize = 140usize;
4783 pub const DEFAULT: Self = Self {
4784 time_usec: 0_u64,
4785 active: 0_u32,
4786 actuator: [0.0_f32; 32usize],
4787 };
4788 #[cfg(feature = "arbitrary")]
4789 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4790 use arbitrary::{Arbitrary, Unstructured};
4791 let mut buf = [0u8; 1024];
4792 rng.fill_bytes(&mut buf);
4793 let mut unstructured = Unstructured::new(&buf);
4794 Self::arbitrary(&mut unstructured).unwrap_or_default()
4795 }
4796}
4797impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4798 fn default() -> Self {
4799 Self::DEFAULT.clone()
4800 }
4801}
4802impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4803 type Message = MavMessage;
4804 const ID: u32 = 375u32;
4805 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4806 const EXTRA_CRC: u8 = 251u8;
4807 const ENCODED_LEN: usize = 140usize;
4808 fn deser(
4809 _version: MavlinkVersion,
4810 __input: &[u8],
4811 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4812 let avail_len = __input.len();
4813 let mut payload_buf = [0; Self::ENCODED_LEN];
4814 let mut buf = if avail_len < Self::ENCODED_LEN {
4815 payload_buf[0..avail_len].copy_from_slice(__input);
4816 Bytes::new(&payload_buf)
4817 } else {
4818 Bytes::new(__input)
4819 };
4820 let mut __struct = Self::default();
4821 __struct.time_usec = buf.get_u64_le();
4822 __struct.active = buf.get_u32_le();
4823 for v in &mut __struct.actuator {
4824 let val = buf.get_f32_le();
4825 *v = val;
4826 }
4827 Ok(__struct)
4828 }
4829 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4830 let mut __tmp = BytesMut::new(bytes);
4831 #[allow(clippy::absurd_extreme_comparisons)]
4832 #[allow(unused_comparisons)]
4833 if __tmp.remaining() < Self::ENCODED_LEN {
4834 panic!(
4835 "buffer is too small (need {} bytes, but got {})",
4836 Self::ENCODED_LEN,
4837 __tmp.remaining(),
4838 )
4839 }
4840 __tmp.put_u64_le(self.time_usec);
4841 __tmp.put_u32_le(self.active);
4842 for val in &self.actuator {
4843 __tmp.put_f32_le(*val);
4844 }
4845 if matches!(version, MavlinkVersion::V2) {
4846 let len = __tmp.len();
4847 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4848 } else {
4849 __tmp.len()
4850 }
4851 }
4852}
4853#[doc = "The location and information of an ADSB vehicle."]
4854#[doc = ""]
4855#[doc = "ID: 246"]
4856#[derive(Debug, Clone, PartialEq)]
4857#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4859#[cfg_attr(feature = "ts", derive(TS))]
4860#[cfg_attr(feature = "ts", ts(export))]
4861pub struct ADSB_VEHICLE_DATA {
4862 #[doc = "ICAO address"]
4863 pub ICAO_address: u32,
4864 #[doc = "Latitude"]
4865 pub lat: i32,
4866 #[doc = "Longitude"]
4867 pub lon: i32,
4868 #[doc = "Altitude(ASL)"]
4869 pub altitude: i32,
4870 #[doc = "Course over ground"]
4871 pub heading: u16,
4872 #[doc = "The horizontal velocity"]
4873 pub hor_velocity: u16,
4874 #[doc = "The vertical velocity. Positive is up"]
4875 pub ver_velocity: i16,
4876 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4877 pub flags: AdsbFlags,
4878 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4879 pub squawk: u16,
4880 #[doc = "ADSB altitude type."]
4881 pub altitude_type: AdsbAltitudeType,
4882 #[doc = "The callsign, 8+null"]
4883 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4884 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4885 pub callsign: [u8; 9],
4886 #[doc = "ADSB emitter type."]
4887 pub emitter_type: AdsbEmitterType,
4888 #[doc = "Time since last communication in seconds"]
4889 pub tslc: u8,
4890}
4891impl ADSB_VEHICLE_DATA {
4892 pub const ENCODED_LEN: usize = 38usize;
4893 pub const DEFAULT: Self = Self {
4894 ICAO_address: 0_u32,
4895 lat: 0_i32,
4896 lon: 0_i32,
4897 altitude: 0_i32,
4898 heading: 0_u16,
4899 hor_velocity: 0_u16,
4900 ver_velocity: 0_i16,
4901 flags: AdsbFlags::DEFAULT,
4902 squawk: 0_u16,
4903 altitude_type: AdsbAltitudeType::DEFAULT,
4904 callsign: [0_u8; 9usize],
4905 emitter_type: AdsbEmitterType::DEFAULT,
4906 tslc: 0_u8,
4907 };
4908 #[cfg(feature = "arbitrary")]
4909 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4910 use arbitrary::{Arbitrary, Unstructured};
4911 let mut buf = [0u8; 1024];
4912 rng.fill_bytes(&mut buf);
4913 let mut unstructured = Unstructured::new(&buf);
4914 Self::arbitrary(&mut unstructured).unwrap_or_default()
4915 }
4916}
4917impl Default for ADSB_VEHICLE_DATA {
4918 fn default() -> Self {
4919 Self::DEFAULT.clone()
4920 }
4921}
4922impl MessageData for ADSB_VEHICLE_DATA {
4923 type Message = MavMessage;
4924 const ID: u32 = 246u32;
4925 const NAME: &'static str = "ADSB_VEHICLE";
4926 const EXTRA_CRC: u8 = 184u8;
4927 const ENCODED_LEN: usize = 38usize;
4928 fn deser(
4929 _version: MavlinkVersion,
4930 __input: &[u8],
4931 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4932 let avail_len = __input.len();
4933 let mut payload_buf = [0; Self::ENCODED_LEN];
4934 let mut buf = if avail_len < Self::ENCODED_LEN {
4935 payload_buf[0..avail_len].copy_from_slice(__input);
4936 Bytes::new(&payload_buf)
4937 } else {
4938 Bytes::new(__input)
4939 };
4940 let mut __struct = Self::default();
4941 __struct.ICAO_address = buf.get_u32_le();
4942 __struct.lat = buf.get_i32_le();
4943 __struct.lon = buf.get_i32_le();
4944 __struct.altitude = buf.get_i32_le();
4945 __struct.heading = buf.get_u16_le();
4946 __struct.hor_velocity = buf.get_u16_le();
4947 __struct.ver_velocity = buf.get_i16_le();
4948 let tmp = buf.get_u16_le();
4949 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4950 ::mavlink_core::error::ParserError::InvalidFlag {
4951 flag_type: "AdsbFlags",
4952 value: tmp as u32,
4953 },
4954 )?;
4955 __struct.squawk = buf.get_u16_le();
4956 let tmp = buf.get_u8();
4957 __struct.altitude_type =
4958 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4959 enum_type: "AdsbAltitudeType",
4960 value: tmp as u32,
4961 })?;
4962 for v in &mut __struct.callsign {
4963 let val = buf.get_u8();
4964 *v = val;
4965 }
4966 let tmp = buf.get_u8();
4967 __struct.emitter_type =
4968 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4969 enum_type: "AdsbEmitterType",
4970 value: tmp as u32,
4971 })?;
4972 __struct.tslc = buf.get_u8();
4973 Ok(__struct)
4974 }
4975 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4976 let mut __tmp = BytesMut::new(bytes);
4977 #[allow(clippy::absurd_extreme_comparisons)]
4978 #[allow(unused_comparisons)]
4979 if __tmp.remaining() < Self::ENCODED_LEN {
4980 panic!(
4981 "buffer is too small (need {} bytes, but got {})",
4982 Self::ENCODED_LEN,
4983 __tmp.remaining(),
4984 )
4985 }
4986 __tmp.put_u32_le(self.ICAO_address);
4987 __tmp.put_i32_le(self.lat);
4988 __tmp.put_i32_le(self.lon);
4989 __tmp.put_i32_le(self.altitude);
4990 __tmp.put_u16_le(self.heading);
4991 __tmp.put_u16_le(self.hor_velocity);
4992 __tmp.put_i16_le(self.ver_velocity);
4993 __tmp.put_u16_le(self.flags.bits());
4994 __tmp.put_u16_le(self.squawk);
4995 __tmp.put_u8(self.altitude_type as u8);
4996 for val in &self.callsign {
4997 __tmp.put_u8(*val);
4998 }
4999 __tmp.put_u8(self.emitter_type as u8);
5000 __tmp.put_u8(self.tslc);
5001 if matches!(version, MavlinkVersion::V2) {
5002 let len = __tmp.len();
5003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5004 } else {
5005 __tmp.len()
5006 }
5007 }
5008}
5009#[doc = "The location and information of an AIS vessel."]
5010#[doc = ""]
5011#[doc = "ID: 301"]
5012#[derive(Debug, Clone, PartialEq)]
5013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5015#[cfg_attr(feature = "ts", derive(TS))]
5016#[cfg_attr(feature = "ts", ts(export))]
5017pub struct AIS_VESSEL_DATA {
5018 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5019 pub MMSI: u32,
5020 #[doc = "Latitude"]
5021 pub lat: i32,
5022 #[doc = "Longitude"]
5023 pub lon: i32,
5024 #[doc = "Course over ground"]
5025 pub COG: u16,
5026 #[doc = "True heading"]
5027 pub heading: u16,
5028 #[doc = "Speed over ground"]
5029 pub velocity: u16,
5030 #[doc = "Distance from lat/lon location to bow"]
5031 pub dimension_bow: u16,
5032 #[doc = "Distance from lat/lon location to stern"]
5033 pub dimension_stern: u16,
5034 #[doc = "Time since last communication in seconds"]
5035 pub tslc: u16,
5036 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5037 pub flags: AisFlags,
5038 #[doc = "Turn rate"]
5039 pub turn_rate: i8,
5040 #[doc = "Navigational status"]
5041 pub navigational_status: AisNavStatus,
5042 #[doc = "Type of vessels"]
5043 pub mavtype: AisType,
5044 #[doc = "Distance from lat/lon location to port side"]
5045 pub dimension_port: u8,
5046 #[doc = "Distance from lat/lon location to starboard side"]
5047 pub dimension_starboard: u8,
5048 #[doc = "The vessel callsign"]
5049 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5050 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5051 pub callsign: [u8; 7],
5052 #[doc = "The vessel name"]
5053 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5054 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5055 pub name: [u8; 20],
5056}
5057impl AIS_VESSEL_DATA {
5058 pub const ENCODED_LEN: usize = 58usize;
5059 pub const DEFAULT: Self = Self {
5060 MMSI: 0_u32,
5061 lat: 0_i32,
5062 lon: 0_i32,
5063 COG: 0_u16,
5064 heading: 0_u16,
5065 velocity: 0_u16,
5066 dimension_bow: 0_u16,
5067 dimension_stern: 0_u16,
5068 tslc: 0_u16,
5069 flags: AisFlags::DEFAULT,
5070 turn_rate: 0_i8,
5071 navigational_status: AisNavStatus::DEFAULT,
5072 mavtype: AisType::DEFAULT,
5073 dimension_port: 0_u8,
5074 dimension_starboard: 0_u8,
5075 callsign: [0_u8; 7usize],
5076 name: [0_u8; 20usize],
5077 };
5078 #[cfg(feature = "arbitrary")]
5079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5080 use arbitrary::{Arbitrary, Unstructured};
5081 let mut buf = [0u8; 1024];
5082 rng.fill_bytes(&mut buf);
5083 let mut unstructured = Unstructured::new(&buf);
5084 Self::arbitrary(&mut unstructured).unwrap_or_default()
5085 }
5086}
5087impl Default for AIS_VESSEL_DATA {
5088 fn default() -> Self {
5089 Self::DEFAULT.clone()
5090 }
5091}
5092impl MessageData for AIS_VESSEL_DATA {
5093 type Message = MavMessage;
5094 const ID: u32 = 301u32;
5095 const NAME: &'static str = "AIS_VESSEL";
5096 const EXTRA_CRC: u8 = 243u8;
5097 const ENCODED_LEN: usize = 58usize;
5098 fn deser(
5099 _version: MavlinkVersion,
5100 __input: &[u8],
5101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5102 let avail_len = __input.len();
5103 let mut payload_buf = [0; Self::ENCODED_LEN];
5104 let mut buf = if avail_len < Self::ENCODED_LEN {
5105 payload_buf[0..avail_len].copy_from_slice(__input);
5106 Bytes::new(&payload_buf)
5107 } else {
5108 Bytes::new(__input)
5109 };
5110 let mut __struct = Self::default();
5111 __struct.MMSI = buf.get_u32_le();
5112 __struct.lat = buf.get_i32_le();
5113 __struct.lon = buf.get_i32_le();
5114 __struct.COG = buf.get_u16_le();
5115 __struct.heading = buf.get_u16_le();
5116 __struct.velocity = buf.get_u16_le();
5117 __struct.dimension_bow = buf.get_u16_le();
5118 __struct.dimension_stern = buf.get_u16_le();
5119 __struct.tslc = buf.get_u16_le();
5120 let tmp = buf.get_u16_le();
5121 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
5122 ::mavlink_core::error::ParserError::InvalidFlag {
5123 flag_type: "AisFlags",
5124 value: tmp as u32,
5125 },
5126 )?;
5127 __struct.turn_rate = buf.get_i8();
5128 let tmp = buf.get_u8();
5129 __struct.navigational_status =
5130 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5131 enum_type: "AisNavStatus",
5132 value: tmp as u32,
5133 })?;
5134 let tmp = buf.get_u8();
5135 __struct.mavtype =
5136 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5137 enum_type: "AisType",
5138 value: tmp as u32,
5139 })?;
5140 __struct.dimension_port = buf.get_u8();
5141 __struct.dimension_starboard = buf.get_u8();
5142 for v in &mut __struct.callsign {
5143 let val = buf.get_u8();
5144 *v = val;
5145 }
5146 for v in &mut __struct.name {
5147 let val = buf.get_u8();
5148 *v = val;
5149 }
5150 Ok(__struct)
5151 }
5152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5153 let mut __tmp = BytesMut::new(bytes);
5154 #[allow(clippy::absurd_extreme_comparisons)]
5155 #[allow(unused_comparisons)]
5156 if __tmp.remaining() < Self::ENCODED_LEN {
5157 panic!(
5158 "buffer is too small (need {} bytes, but got {})",
5159 Self::ENCODED_LEN,
5160 __tmp.remaining(),
5161 )
5162 }
5163 __tmp.put_u32_le(self.MMSI);
5164 __tmp.put_i32_le(self.lat);
5165 __tmp.put_i32_le(self.lon);
5166 __tmp.put_u16_le(self.COG);
5167 __tmp.put_u16_le(self.heading);
5168 __tmp.put_u16_le(self.velocity);
5169 __tmp.put_u16_le(self.dimension_bow);
5170 __tmp.put_u16_le(self.dimension_stern);
5171 __tmp.put_u16_le(self.tslc);
5172 __tmp.put_u16_le(self.flags.bits());
5173 __tmp.put_i8(self.turn_rate);
5174 __tmp.put_u8(self.navigational_status as u8);
5175 __tmp.put_u8(self.mavtype as u8);
5176 __tmp.put_u8(self.dimension_port);
5177 __tmp.put_u8(self.dimension_starboard);
5178 for val in &self.callsign {
5179 __tmp.put_u8(*val);
5180 }
5181 for val in &self.name {
5182 __tmp.put_u8(*val);
5183 }
5184 if matches!(version, MavlinkVersion::V2) {
5185 let len = __tmp.len();
5186 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5187 } else {
5188 __tmp.len()
5189 }
5190 }
5191}
5192#[doc = "The current system altitude."]
5193#[doc = ""]
5194#[doc = "ID: 141"]
5195#[derive(Debug, Clone, PartialEq)]
5196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5198#[cfg_attr(feature = "ts", derive(TS))]
5199#[cfg_attr(feature = "ts", ts(export))]
5200pub struct ALTITUDE_DATA {
5201 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5202 pub time_usec: u64,
5203 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5204 pub altitude_monotonic: f32,
5205 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5206 pub altitude_amsl: f32,
5207 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5208 pub altitude_local: f32,
5209 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5210 pub altitude_relative: f32,
5211 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5212 pub altitude_terrain: f32,
5213 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5214 pub bottom_clearance: f32,
5215}
5216impl ALTITUDE_DATA {
5217 pub const ENCODED_LEN: usize = 32usize;
5218 pub const DEFAULT: Self = Self {
5219 time_usec: 0_u64,
5220 altitude_monotonic: 0.0_f32,
5221 altitude_amsl: 0.0_f32,
5222 altitude_local: 0.0_f32,
5223 altitude_relative: 0.0_f32,
5224 altitude_terrain: 0.0_f32,
5225 bottom_clearance: 0.0_f32,
5226 };
5227 #[cfg(feature = "arbitrary")]
5228 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5229 use arbitrary::{Arbitrary, Unstructured};
5230 let mut buf = [0u8; 1024];
5231 rng.fill_bytes(&mut buf);
5232 let mut unstructured = Unstructured::new(&buf);
5233 Self::arbitrary(&mut unstructured).unwrap_or_default()
5234 }
5235}
5236impl Default for ALTITUDE_DATA {
5237 fn default() -> Self {
5238 Self::DEFAULT.clone()
5239 }
5240}
5241impl MessageData for ALTITUDE_DATA {
5242 type Message = MavMessage;
5243 const ID: u32 = 141u32;
5244 const NAME: &'static str = "ALTITUDE";
5245 const EXTRA_CRC: u8 = 47u8;
5246 const ENCODED_LEN: usize = 32usize;
5247 fn deser(
5248 _version: MavlinkVersion,
5249 __input: &[u8],
5250 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5251 let avail_len = __input.len();
5252 let mut payload_buf = [0; Self::ENCODED_LEN];
5253 let mut buf = if avail_len < Self::ENCODED_LEN {
5254 payload_buf[0..avail_len].copy_from_slice(__input);
5255 Bytes::new(&payload_buf)
5256 } else {
5257 Bytes::new(__input)
5258 };
5259 let mut __struct = Self::default();
5260 __struct.time_usec = buf.get_u64_le();
5261 __struct.altitude_monotonic = buf.get_f32_le();
5262 __struct.altitude_amsl = buf.get_f32_le();
5263 __struct.altitude_local = buf.get_f32_le();
5264 __struct.altitude_relative = buf.get_f32_le();
5265 __struct.altitude_terrain = buf.get_f32_le();
5266 __struct.bottom_clearance = buf.get_f32_le();
5267 Ok(__struct)
5268 }
5269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5270 let mut __tmp = BytesMut::new(bytes);
5271 #[allow(clippy::absurd_extreme_comparisons)]
5272 #[allow(unused_comparisons)]
5273 if __tmp.remaining() < Self::ENCODED_LEN {
5274 panic!(
5275 "buffer is too small (need {} bytes, but got {})",
5276 Self::ENCODED_LEN,
5277 __tmp.remaining(),
5278 )
5279 }
5280 __tmp.put_u64_le(self.time_usec);
5281 __tmp.put_f32_le(self.altitude_monotonic);
5282 __tmp.put_f32_le(self.altitude_amsl);
5283 __tmp.put_f32_le(self.altitude_local);
5284 __tmp.put_f32_le(self.altitude_relative);
5285 __tmp.put_f32_le(self.altitude_terrain);
5286 __tmp.put_f32_le(self.bottom_clearance);
5287 if matches!(version, MavlinkVersion::V2) {
5288 let len = __tmp.len();
5289 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5290 } else {
5291 __tmp.len()
5292 }
5293 }
5294}
5295#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5296#[doc = ""]
5297#[doc = "ID: 30"]
5298#[derive(Debug, Clone, PartialEq)]
5299#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5300#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5301#[cfg_attr(feature = "ts", derive(TS))]
5302#[cfg_attr(feature = "ts", ts(export))]
5303pub struct ATTITUDE_DATA {
5304 #[doc = "Timestamp (time since system boot)."]
5305 pub time_boot_ms: u32,
5306 #[doc = "Roll angle (-pi..+pi)"]
5307 pub roll: f32,
5308 #[doc = "Pitch angle (-pi..+pi)"]
5309 pub pitch: f32,
5310 #[doc = "Yaw angle (-pi..+pi)"]
5311 pub yaw: f32,
5312 #[doc = "Roll angular speed"]
5313 pub rollspeed: f32,
5314 #[doc = "Pitch angular speed"]
5315 pub pitchspeed: f32,
5316 #[doc = "Yaw angular speed"]
5317 pub yawspeed: f32,
5318}
5319impl ATTITUDE_DATA {
5320 pub const ENCODED_LEN: usize = 28usize;
5321 pub const DEFAULT: Self = Self {
5322 time_boot_ms: 0_u32,
5323 roll: 0.0_f32,
5324 pitch: 0.0_f32,
5325 yaw: 0.0_f32,
5326 rollspeed: 0.0_f32,
5327 pitchspeed: 0.0_f32,
5328 yawspeed: 0.0_f32,
5329 };
5330 #[cfg(feature = "arbitrary")]
5331 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5332 use arbitrary::{Arbitrary, Unstructured};
5333 let mut buf = [0u8; 1024];
5334 rng.fill_bytes(&mut buf);
5335 let mut unstructured = Unstructured::new(&buf);
5336 Self::arbitrary(&mut unstructured).unwrap_or_default()
5337 }
5338}
5339impl Default for ATTITUDE_DATA {
5340 fn default() -> Self {
5341 Self::DEFAULT.clone()
5342 }
5343}
5344impl MessageData for ATTITUDE_DATA {
5345 type Message = MavMessage;
5346 const ID: u32 = 30u32;
5347 const NAME: &'static str = "ATTITUDE";
5348 const EXTRA_CRC: u8 = 39u8;
5349 const ENCODED_LEN: usize = 28usize;
5350 fn deser(
5351 _version: MavlinkVersion,
5352 __input: &[u8],
5353 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5354 let avail_len = __input.len();
5355 let mut payload_buf = [0; Self::ENCODED_LEN];
5356 let mut buf = if avail_len < Self::ENCODED_LEN {
5357 payload_buf[0..avail_len].copy_from_slice(__input);
5358 Bytes::new(&payload_buf)
5359 } else {
5360 Bytes::new(__input)
5361 };
5362 let mut __struct = Self::default();
5363 __struct.time_boot_ms = buf.get_u32_le();
5364 __struct.roll = buf.get_f32_le();
5365 __struct.pitch = buf.get_f32_le();
5366 __struct.yaw = buf.get_f32_le();
5367 __struct.rollspeed = buf.get_f32_le();
5368 __struct.pitchspeed = buf.get_f32_le();
5369 __struct.yawspeed = buf.get_f32_le();
5370 Ok(__struct)
5371 }
5372 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5373 let mut __tmp = BytesMut::new(bytes);
5374 #[allow(clippy::absurd_extreme_comparisons)]
5375 #[allow(unused_comparisons)]
5376 if __tmp.remaining() < Self::ENCODED_LEN {
5377 panic!(
5378 "buffer is too small (need {} bytes, but got {})",
5379 Self::ENCODED_LEN,
5380 __tmp.remaining(),
5381 )
5382 }
5383 __tmp.put_u32_le(self.time_boot_ms);
5384 __tmp.put_f32_le(self.roll);
5385 __tmp.put_f32_le(self.pitch);
5386 __tmp.put_f32_le(self.yaw);
5387 __tmp.put_f32_le(self.rollspeed);
5388 __tmp.put_f32_le(self.pitchspeed);
5389 __tmp.put_f32_le(self.yawspeed);
5390 if matches!(version, MavlinkVersion::V2) {
5391 let len = __tmp.len();
5392 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5393 } else {
5394 __tmp.len()
5395 }
5396 }
5397}
5398#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5399#[doc = ""]
5400#[doc = "ID: 31"]
5401#[derive(Debug, Clone, PartialEq)]
5402#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5403#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5404#[cfg_attr(feature = "ts", derive(TS))]
5405#[cfg_attr(feature = "ts", ts(export))]
5406pub struct ATTITUDE_QUATERNION_DATA {
5407 #[doc = "Timestamp (time since system boot)."]
5408 pub time_boot_ms: u32,
5409 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5410 pub q1: f32,
5411 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5412 pub q2: f32,
5413 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5414 pub q3: f32,
5415 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5416 pub q4: f32,
5417 #[doc = "Roll angular speed"]
5418 pub rollspeed: f32,
5419 #[doc = "Pitch angular speed"]
5420 pub pitchspeed: f32,
5421 #[doc = "Yaw angular speed"]
5422 pub yawspeed: f32,
5423 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5424 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5425 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5426 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5427 pub repr_offset_q: [f32; 4],
5428}
5429impl ATTITUDE_QUATERNION_DATA {
5430 pub const ENCODED_LEN: usize = 48usize;
5431 pub const DEFAULT: Self = Self {
5432 time_boot_ms: 0_u32,
5433 q1: 0.0_f32,
5434 q2: 0.0_f32,
5435 q3: 0.0_f32,
5436 q4: 0.0_f32,
5437 rollspeed: 0.0_f32,
5438 pitchspeed: 0.0_f32,
5439 yawspeed: 0.0_f32,
5440 repr_offset_q: [0.0_f32; 4usize],
5441 };
5442 #[cfg(feature = "arbitrary")]
5443 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5444 use arbitrary::{Arbitrary, Unstructured};
5445 let mut buf = [0u8; 1024];
5446 rng.fill_bytes(&mut buf);
5447 let mut unstructured = Unstructured::new(&buf);
5448 Self::arbitrary(&mut unstructured).unwrap_or_default()
5449 }
5450}
5451impl Default for ATTITUDE_QUATERNION_DATA {
5452 fn default() -> Self {
5453 Self::DEFAULT.clone()
5454 }
5455}
5456impl MessageData for ATTITUDE_QUATERNION_DATA {
5457 type Message = MavMessage;
5458 const ID: u32 = 31u32;
5459 const NAME: &'static str = "ATTITUDE_QUATERNION";
5460 const EXTRA_CRC: u8 = 246u8;
5461 const ENCODED_LEN: usize = 48usize;
5462 fn deser(
5463 _version: MavlinkVersion,
5464 __input: &[u8],
5465 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5466 let avail_len = __input.len();
5467 let mut payload_buf = [0; Self::ENCODED_LEN];
5468 let mut buf = if avail_len < Self::ENCODED_LEN {
5469 payload_buf[0..avail_len].copy_from_slice(__input);
5470 Bytes::new(&payload_buf)
5471 } else {
5472 Bytes::new(__input)
5473 };
5474 let mut __struct = Self::default();
5475 __struct.time_boot_ms = buf.get_u32_le();
5476 __struct.q1 = buf.get_f32_le();
5477 __struct.q2 = buf.get_f32_le();
5478 __struct.q3 = buf.get_f32_le();
5479 __struct.q4 = buf.get_f32_le();
5480 __struct.rollspeed = buf.get_f32_le();
5481 __struct.pitchspeed = buf.get_f32_le();
5482 __struct.yawspeed = buf.get_f32_le();
5483 for v in &mut __struct.repr_offset_q {
5484 let val = buf.get_f32_le();
5485 *v = val;
5486 }
5487 Ok(__struct)
5488 }
5489 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5490 let mut __tmp = BytesMut::new(bytes);
5491 #[allow(clippy::absurd_extreme_comparisons)]
5492 #[allow(unused_comparisons)]
5493 if __tmp.remaining() < Self::ENCODED_LEN {
5494 panic!(
5495 "buffer is too small (need {} bytes, but got {})",
5496 Self::ENCODED_LEN,
5497 __tmp.remaining(),
5498 )
5499 }
5500 __tmp.put_u32_le(self.time_boot_ms);
5501 __tmp.put_f32_le(self.q1);
5502 __tmp.put_f32_le(self.q2);
5503 __tmp.put_f32_le(self.q3);
5504 __tmp.put_f32_le(self.q4);
5505 __tmp.put_f32_le(self.rollspeed);
5506 __tmp.put_f32_le(self.pitchspeed);
5507 __tmp.put_f32_le(self.yawspeed);
5508 if matches!(version, MavlinkVersion::V2) {
5509 for val in &self.repr_offset_q {
5510 __tmp.put_f32_le(*val);
5511 }
5512 let len = __tmp.len();
5513 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5514 } else {
5515 __tmp.len()
5516 }
5517 }
5518}
5519#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5520#[doc = ""]
5521#[doc = "ID: 61"]
5522#[derive(Debug, Clone, PartialEq)]
5523#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5524#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5525#[cfg_attr(feature = "ts", derive(TS))]
5526#[cfg_attr(feature = "ts", ts(export))]
5527pub struct ATTITUDE_QUATERNION_COV_DATA {
5528 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5529 pub time_usec: u64,
5530 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5531 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5532 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5533 pub q: [f32; 4],
5534 #[doc = "Roll angular speed"]
5535 pub rollspeed: f32,
5536 #[doc = "Pitch angular speed"]
5537 pub pitchspeed: f32,
5538 #[doc = "Yaw angular speed"]
5539 pub yawspeed: f32,
5540 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5541 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5542 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5543 pub covariance: [f32; 9],
5544}
5545impl ATTITUDE_QUATERNION_COV_DATA {
5546 pub const ENCODED_LEN: usize = 72usize;
5547 pub const DEFAULT: Self = Self {
5548 time_usec: 0_u64,
5549 q: [0.0_f32; 4usize],
5550 rollspeed: 0.0_f32,
5551 pitchspeed: 0.0_f32,
5552 yawspeed: 0.0_f32,
5553 covariance: [0.0_f32; 9usize],
5554 };
5555 #[cfg(feature = "arbitrary")]
5556 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5557 use arbitrary::{Arbitrary, Unstructured};
5558 let mut buf = [0u8; 1024];
5559 rng.fill_bytes(&mut buf);
5560 let mut unstructured = Unstructured::new(&buf);
5561 Self::arbitrary(&mut unstructured).unwrap_or_default()
5562 }
5563}
5564impl Default for ATTITUDE_QUATERNION_COV_DATA {
5565 fn default() -> Self {
5566 Self::DEFAULT.clone()
5567 }
5568}
5569impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5570 type Message = MavMessage;
5571 const ID: u32 = 61u32;
5572 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5573 const EXTRA_CRC: u8 = 167u8;
5574 const ENCODED_LEN: usize = 72usize;
5575 fn deser(
5576 _version: MavlinkVersion,
5577 __input: &[u8],
5578 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5579 let avail_len = __input.len();
5580 let mut payload_buf = [0; Self::ENCODED_LEN];
5581 let mut buf = if avail_len < Self::ENCODED_LEN {
5582 payload_buf[0..avail_len].copy_from_slice(__input);
5583 Bytes::new(&payload_buf)
5584 } else {
5585 Bytes::new(__input)
5586 };
5587 let mut __struct = Self::default();
5588 __struct.time_usec = buf.get_u64_le();
5589 for v in &mut __struct.q {
5590 let val = buf.get_f32_le();
5591 *v = val;
5592 }
5593 __struct.rollspeed = buf.get_f32_le();
5594 __struct.pitchspeed = buf.get_f32_le();
5595 __struct.yawspeed = buf.get_f32_le();
5596 for v in &mut __struct.covariance {
5597 let val = buf.get_f32_le();
5598 *v = val;
5599 }
5600 Ok(__struct)
5601 }
5602 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5603 let mut __tmp = BytesMut::new(bytes);
5604 #[allow(clippy::absurd_extreme_comparisons)]
5605 #[allow(unused_comparisons)]
5606 if __tmp.remaining() < Self::ENCODED_LEN {
5607 panic!(
5608 "buffer is too small (need {} bytes, but got {})",
5609 Self::ENCODED_LEN,
5610 __tmp.remaining(),
5611 )
5612 }
5613 __tmp.put_u64_le(self.time_usec);
5614 for val in &self.q {
5615 __tmp.put_f32_le(*val);
5616 }
5617 __tmp.put_f32_le(self.rollspeed);
5618 __tmp.put_f32_le(self.pitchspeed);
5619 __tmp.put_f32_le(self.yawspeed);
5620 for val in &self.covariance {
5621 __tmp.put_f32_le(*val);
5622 }
5623 if matches!(version, MavlinkVersion::V2) {
5624 let len = __tmp.len();
5625 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5626 } else {
5627 __tmp.len()
5628 }
5629 }
5630}
5631#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5632#[doc = ""]
5633#[doc = "ID: 83"]
5634#[derive(Debug, Clone, PartialEq)]
5635#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5637#[cfg_attr(feature = "ts", derive(TS))]
5638#[cfg_attr(feature = "ts", ts(export))]
5639pub struct ATTITUDE_TARGET_DATA {
5640 #[doc = "Timestamp (time since system boot)."]
5641 pub time_boot_ms: u32,
5642 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5643 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5644 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5645 pub q: [f32; 4],
5646 #[doc = "Body roll rate"]
5647 pub body_roll_rate: f32,
5648 #[doc = "Body pitch rate"]
5649 pub body_pitch_rate: f32,
5650 #[doc = "Body yaw rate"]
5651 pub body_yaw_rate: f32,
5652 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5653 pub thrust: f32,
5654 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5655 pub type_mask: AttitudeTargetTypemask,
5656}
5657impl ATTITUDE_TARGET_DATA {
5658 pub const ENCODED_LEN: usize = 37usize;
5659 pub const DEFAULT: Self = Self {
5660 time_boot_ms: 0_u32,
5661 q: [0.0_f32; 4usize],
5662 body_roll_rate: 0.0_f32,
5663 body_pitch_rate: 0.0_f32,
5664 body_yaw_rate: 0.0_f32,
5665 thrust: 0.0_f32,
5666 type_mask: AttitudeTargetTypemask::DEFAULT,
5667 };
5668 #[cfg(feature = "arbitrary")]
5669 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5670 use arbitrary::{Arbitrary, Unstructured};
5671 let mut buf = [0u8; 1024];
5672 rng.fill_bytes(&mut buf);
5673 let mut unstructured = Unstructured::new(&buf);
5674 Self::arbitrary(&mut unstructured).unwrap_or_default()
5675 }
5676}
5677impl Default for ATTITUDE_TARGET_DATA {
5678 fn default() -> Self {
5679 Self::DEFAULT.clone()
5680 }
5681}
5682impl MessageData for ATTITUDE_TARGET_DATA {
5683 type Message = MavMessage;
5684 const ID: u32 = 83u32;
5685 const NAME: &'static str = "ATTITUDE_TARGET";
5686 const EXTRA_CRC: u8 = 22u8;
5687 const ENCODED_LEN: usize = 37usize;
5688 fn deser(
5689 _version: MavlinkVersion,
5690 __input: &[u8],
5691 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5692 let avail_len = __input.len();
5693 let mut payload_buf = [0; Self::ENCODED_LEN];
5694 let mut buf = if avail_len < Self::ENCODED_LEN {
5695 payload_buf[0..avail_len].copy_from_slice(__input);
5696 Bytes::new(&payload_buf)
5697 } else {
5698 Bytes::new(__input)
5699 };
5700 let mut __struct = Self::default();
5701 __struct.time_boot_ms = buf.get_u32_le();
5702 for v in &mut __struct.q {
5703 let val = buf.get_f32_le();
5704 *v = val;
5705 }
5706 __struct.body_roll_rate = buf.get_f32_le();
5707 __struct.body_pitch_rate = buf.get_f32_le();
5708 __struct.body_yaw_rate = buf.get_f32_le();
5709 __struct.thrust = buf.get_f32_le();
5710 let tmp = buf.get_u8();
5711 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5712 tmp & AttitudeTargetTypemask::all().bits(),
5713 )
5714 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5715 flag_type: "AttitudeTargetTypemask",
5716 value: tmp as u32,
5717 })?;
5718 Ok(__struct)
5719 }
5720 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5721 let mut __tmp = BytesMut::new(bytes);
5722 #[allow(clippy::absurd_extreme_comparisons)]
5723 #[allow(unused_comparisons)]
5724 if __tmp.remaining() < Self::ENCODED_LEN {
5725 panic!(
5726 "buffer is too small (need {} bytes, but got {})",
5727 Self::ENCODED_LEN,
5728 __tmp.remaining(),
5729 )
5730 }
5731 __tmp.put_u32_le(self.time_boot_ms);
5732 for val in &self.q {
5733 __tmp.put_f32_le(*val);
5734 }
5735 __tmp.put_f32_le(self.body_roll_rate);
5736 __tmp.put_f32_le(self.body_pitch_rate);
5737 __tmp.put_f32_le(self.body_yaw_rate);
5738 __tmp.put_f32_le(self.thrust);
5739 __tmp.put_u8(self.type_mask.bits());
5740 if matches!(version, MavlinkVersion::V2) {
5741 let len = __tmp.len();
5742 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5743 } else {
5744 __tmp.len()
5745 }
5746 }
5747}
5748#[doc = "Motion capture attitude and position."]
5749#[doc = ""]
5750#[doc = "ID: 138"]
5751#[derive(Debug, Clone, PartialEq)]
5752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5753#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5754#[cfg_attr(feature = "ts", derive(TS))]
5755#[cfg_attr(feature = "ts", ts(export))]
5756pub struct ATT_POS_MOCAP_DATA {
5757 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5758 pub time_usec: u64,
5759 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5760 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5761 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5762 pub q: [f32; 4],
5763 #[doc = "X position (NED)"]
5764 pub x: f32,
5765 #[doc = "Y position (NED)"]
5766 pub y: f32,
5767 #[doc = "Z position (NED)"]
5768 pub z: f32,
5769 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5770 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5771 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5772 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5773 pub covariance: [f32; 21],
5774}
5775impl ATT_POS_MOCAP_DATA {
5776 pub const ENCODED_LEN: usize = 120usize;
5777 pub const DEFAULT: Self = Self {
5778 time_usec: 0_u64,
5779 q: [0.0_f32; 4usize],
5780 x: 0.0_f32,
5781 y: 0.0_f32,
5782 z: 0.0_f32,
5783 covariance: [0.0_f32; 21usize],
5784 };
5785 #[cfg(feature = "arbitrary")]
5786 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5787 use arbitrary::{Arbitrary, Unstructured};
5788 let mut buf = [0u8; 1024];
5789 rng.fill_bytes(&mut buf);
5790 let mut unstructured = Unstructured::new(&buf);
5791 Self::arbitrary(&mut unstructured).unwrap_or_default()
5792 }
5793}
5794impl Default for ATT_POS_MOCAP_DATA {
5795 fn default() -> Self {
5796 Self::DEFAULT.clone()
5797 }
5798}
5799impl MessageData for ATT_POS_MOCAP_DATA {
5800 type Message = MavMessage;
5801 const ID: u32 = 138u32;
5802 const NAME: &'static str = "ATT_POS_MOCAP";
5803 const EXTRA_CRC: u8 = 109u8;
5804 const ENCODED_LEN: usize = 120usize;
5805 fn deser(
5806 _version: MavlinkVersion,
5807 __input: &[u8],
5808 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5809 let avail_len = __input.len();
5810 let mut payload_buf = [0; Self::ENCODED_LEN];
5811 let mut buf = if avail_len < Self::ENCODED_LEN {
5812 payload_buf[0..avail_len].copy_from_slice(__input);
5813 Bytes::new(&payload_buf)
5814 } else {
5815 Bytes::new(__input)
5816 };
5817 let mut __struct = Self::default();
5818 __struct.time_usec = buf.get_u64_le();
5819 for v in &mut __struct.q {
5820 let val = buf.get_f32_le();
5821 *v = val;
5822 }
5823 __struct.x = buf.get_f32_le();
5824 __struct.y = buf.get_f32_le();
5825 __struct.z = buf.get_f32_le();
5826 for v in &mut __struct.covariance {
5827 let val = buf.get_f32_le();
5828 *v = val;
5829 }
5830 Ok(__struct)
5831 }
5832 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5833 let mut __tmp = BytesMut::new(bytes);
5834 #[allow(clippy::absurd_extreme_comparisons)]
5835 #[allow(unused_comparisons)]
5836 if __tmp.remaining() < Self::ENCODED_LEN {
5837 panic!(
5838 "buffer is too small (need {} bytes, but got {})",
5839 Self::ENCODED_LEN,
5840 __tmp.remaining(),
5841 )
5842 }
5843 __tmp.put_u64_le(self.time_usec);
5844 for val in &self.q {
5845 __tmp.put_f32_le(*val);
5846 }
5847 __tmp.put_f32_le(self.x);
5848 __tmp.put_f32_le(self.y);
5849 __tmp.put_f32_le(self.z);
5850 if matches!(version, MavlinkVersion::V2) {
5851 for val in &self.covariance {
5852 __tmp.put_f32_le(*val);
5853 }
5854 let len = __tmp.len();
5855 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5856 } else {
5857 __tmp.len()
5858 }
5859 }
5860}
5861#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5862#[doc = ""]
5863#[doc = "ID: 7"]
5864#[derive(Debug, Clone, PartialEq)]
5865#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5866#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5867#[cfg_attr(feature = "ts", derive(TS))]
5868#[cfg_attr(feature = "ts", ts(export))]
5869pub struct AUTH_KEY_DATA {
5870 #[doc = "key"]
5871 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5872 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5873 pub key: [u8; 32],
5874}
5875impl AUTH_KEY_DATA {
5876 pub const ENCODED_LEN: usize = 32usize;
5877 pub const DEFAULT: Self = Self {
5878 key: [0_u8; 32usize],
5879 };
5880 #[cfg(feature = "arbitrary")]
5881 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5882 use arbitrary::{Arbitrary, Unstructured};
5883 let mut buf = [0u8; 1024];
5884 rng.fill_bytes(&mut buf);
5885 let mut unstructured = Unstructured::new(&buf);
5886 Self::arbitrary(&mut unstructured).unwrap_or_default()
5887 }
5888}
5889impl Default for AUTH_KEY_DATA {
5890 fn default() -> Self {
5891 Self::DEFAULT.clone()
5892 }
5893}
5894impl MessageData for AUTH_KEY_DATA {
5895 type Message = MavMessage;
5896 const ID: u32 = 7u32;
5897 const NAME: &'static str = "AUTH_KEY";
5898 const EXTRA_CRC: u8 = 119u8;
5899 const ENCODED_LEN: usize = 32usize;
5900 fn deser(
5901 _version: MavlinkVersion,
5902 __input: &[u8],
5903 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5904 let avail_len = __input.len();
5905 let mut payload_buf = [0; Self::ENCODED_LEN];
5906 let mut buf = if avail_len < Self::ENCODED_LEN {
5907 payload_buf[0..avail_len].copy_from_slice(__input);
5908 Bytes::new(&payload_buf)
5909 } else {
5910 Bytes::new(__input)
5911 };
5912 let mut __struct = Self::default();
5913 for v in &mut __struct.key {
5914 let val = buf.get_u8();
5915 *v = val;
5916 }
5917 Ok(__struct)
5918 }
5919 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5920 let mut __tmp = BytesMut::new(bytes);
5921 #[allow(clippy::absurd_extreme_comparisons)]
5922 #[allow(unused_comparisons)]
5923 if __tmp.remaining() < Self::ENCODED_LEN {
5924 panic!(
5925 "buffer is too small (need {} bytes, but got {})",
5926 Self::ENCODED_LEN,
5927 __tmp.remaining(),
5928 )
5929 }
5930 for val in &self.key {
5931 __tmp.put_u8(*val);
5932 }
5933 if matches!(version, MavlinkVersion::V2) {
5934 let len = __tmp.len();
5935 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5936 } else {
5937 __tmp.len()
5938 }
5939 }
5940}
5941#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5942#[doc = ""]
5943#[doc = "ID: 286"]
5944#[derive(Debug, Clone, PartialEq)]
5945#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5947#[cfg_attr(feature = "ts", derive(TS))]
5948#[cfg_attr(feature = "ts", ts(export))]
5949pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5950 #[doc = "Timestamp (time since system boot)."]
5951 pub time_boot_us: u64,
5952 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5953 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5954 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5955 pub q: [f32; 4],
5956 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5957 pub q_estimated_delay_us: u32,
5958 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5959 pub vx: f32,
5960 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5961 pub vy: f32,
5962 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5963 pub vz: f32,
5964 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5965 pub v_estimated_delay_us: u32,
5966 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5967 pub feed_forward_angular_velocity_z: f32,
5968 #[doc = "Bitmap indicating which estimator outputs are valid."]
5969 pub estimator_status: EstimatorStatusFlags,
5970 #[doc = "System ID"]
5971 pub target_system: u8,
5972 #[doc = "Component ID"]
5973 pub target_component: u8,
5974 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5975 pub landed_state: MavLandedState,
5976 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5977 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5978 pub angular_velocity_z: f32,
5979}
5980impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5981 pub const ENCODED_LEN: usize = 57usize;
5982 pub const DEFAULT: Self = Self {
5983 time_boot_us: 0_u64,
5984 q: [0.0_f32; 4usize],
5985 q_estimated_delay_us: 0_u32,
5986 vx: 0.0_f32,
5987 vy: 0.0_f32,
5988 vz: 0.0_f32,
5989 v_estimated_delay_us: 0_u32,
5990 feed_forward_angular_velocity_z: 0.0_f32,
5991 estimator_status: EstimatorStatusFlags::DEFAULT,
5992 target_system: 0_u8,
5993 target_component: 0_u8,
5994 landed_state: MavLandedState::DEFAULT,
5995 angular_velocity_z: 0.0_f32,
5996 };
5997 #[cfg(feature = "arbitrary")]
5998 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5999 use arbitrary::{Arbitrary, Unstructured};
6000 let mut buf = [0u8; 1024];
6001 rng.fill_bytes(&mut buf);
6002 let mut unstructured = Unstructured::new(&buf);
6003 Self::arbitrary(&mut unstructured).unwrap_or_default()
6004 }
6005}
6006impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6007 fn default() -> Self {
6008 Self::DEFAULT.clone()
6009 }
6010}
6011impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6012 type Message = MavMessage;
6013 const ID: u32 = 286u32;
6014 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6015 const EXTRA_CRC: u8 = 210u8;
6016 const ENCODED_LEN: usize = 57usize;
6017 fn deser(
6018 _version: MavlinkVersion,
6019 __input: &[u8],
6020 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6021 let avail_len = __input.len();
6022 let mut payload_buf = [0; Self::ENCODED_LEN];
6023 let mut buf = if avail_len < Self::ENCODED_LEN {
6024 payload_buf[0..avail_len].copy_from_slice(__input);
6025 Bytes::new(&payload_buf)
6026 } else {
6027 Bytes::new(__input)
6028 };
6029 let mut __struct = Self::default();
6030 __struct.time_boot_us = buf.get_u64_le();
6031 for v in &mut __struct.q {
6032 let val = buf.get_f32_le();
6033 *v = val;
6034 }
6035 __struct.q_estimated_delay_us = buf.get_u32_le();
6036 __struct.vx = buf.get_f32_le();
6037 __struct.vy = buf.get_f32_le();
6038 __struct.vz = buf.get_f32_le();
6039 __struct.v_estimated_delay_us = buf.get_u32_le();
6040 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6041 let tmp = buf.get_u16_le();
6042 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6043 tmp & EstimatorStatusFlags::all().bits(),
6044 )
6045 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6046 flag_type: "EstimatorStatusFlags",
6047 value: tmp as u32,
6048 })?;
6049 __struct.target_system = buf.get_u8();
6050 __struct.target_component = buf.get_u8();
6051 let tmp = buf.get_u8();
6052 __struct.landed_state =
6053 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6054 enum_type: "MavLandedState",
6055 value: tmp as u32,
6056 })?;
6057 __struct.angular_velocity_z = buf.get_f32_le();
6058 Ok(__struct)
6059 }
6060 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6061 let mut __tmp = BytesMut::new(bytes);
6062 #[allow(clippy::absurd_extreme_comparisons)]
6063 #[allow(unused_comparisons)]
6064 if __tmp.remaining() < Self::ENCODED_LEN {
6065 panic!(
6066 "buffer is too small (need {} bytes, but got {})",
6067 Self::ENCODED_LEN,
6068 __tmp.remaining(),
6069 )
6070 }
6071 __tmp.put_u64_le(self.time_boot_us);
6072 for val in &self.q {
6073 __tmp.put_f32_le(*val);
6074 }
6075 __tmp.put_u32_le(self.q_estimated_delay_us);
6076 __tmp.put_f32_le(self.vx);
6077 __tmp.put_f32_le(self.vy);
6078 __tmp.put_f32_le(self.vz);
6079 __tmp.put_u32_le(self.v_estimated_delay_us);
6080 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6081 __tmp.put_u16_le(self.estimator_status.bits());
6082 __tmp.put_u8(self.target_system);
6083 __tmp.put_u8(self.target_component);
6084 __tmp.put_u8(self.landed_state as u8);
6085 if matches!(version, MavlinkVersion::V2) {
6086 __tmp.put_f32_le(self.angular_velocity_z);
6087 let len = __tmp.len();
6088 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6089 } else {
6090 __tmp.len()
6091 }
6092 }
6093}
6094#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6095#[doc = ""]
6096#[doc = "ID: 148"]
6097#[derive(Debug, Clone, PartialEq)]
6098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6099#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6100#[cfg_attr(feature = "ts", derive(TS))]
6101#[cfg_attr(feature = "ts", ts(export))]
6102pub struct AUTOPILOT_VERSION_DATA {
6103 #[doc = "Bitmap of capabilities"]
6104 pub capabilities: MavProtocolCapability,
6105 #[doc = "UID if provided by hardware (see uid2)"]
6106 pub uid: u64,
6107 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6108 pub flight_sw_version: u32,
6109 #[doc = "Middleware version number"]
6110 pub middleware_sw_version: u32,
6111 #[doc = "Operating system version number"]
6112 pub os_sw_version: u32,
6113 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6114 pub board_version: u32,
6115 #[doc = "ID of the board vendor"]
6116 pub vendor_id: u16,
6117 #[doc = "ID of the product"]
6118 pub product_id: u16,
6119 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6120 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6121 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6122 pub flight_custom_version: [u8; 8],
6123 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6124 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6125 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6126 pub middleware_custom_version: [u8; 8],
6127 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6128 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6129 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6130 pub os_custom_version: [u8; 8],
6131 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6132 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6133 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6134 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6135 pub uid2: [u8; 18],
6136}
6137impl AUTOPILOT_VERSION_DATA {
6138 pub const ENCODED_LEN: usize = 78usize;
6139 pub const DEFAULT: Self = Self {
6140 capabilities: MavProtocolCapability::DEFAULT,
6141 uid: 0_u64,
6142 flight_sw_version: 0_u32,
6143 middleware_sw_version: 0_u32,
6144 os_sw_version: 0_u32,
6145 board_version: 0_u32,
6146 vendor_id: 0_u16,
6147 product_id: 0_u16,
6148 flight_custom_version: [0_u8; 8usize],
6149 middleware_custom_version: [0_u8; 8usize],
6150 os_custom_version: [0_u8; 8usize],
6151 uid2: [0_u8; 18usize],
6152 };
6153 #[cfg(feature = "arbitrary")]
6154 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6155 use arbitrary::{Arbitrary, Unstructured};
6156 let mut buf = [0u8; 1024];
6157 rng.fill_bytes(&mut buf);
6158 let mut unstructured = Unstructured::new(&buf);
6159 Self::arbitrary(&mut unstructured).unwrap_or_default()
6160 }
6161}
6162impl Default for AUTOPILOT_VERSION_DATA {
6163 fn default() -> Self {
6164 Self::DEFAULT.clone()
6165 }
6166}
6167impl MessageData for AUTOPILOT_VERSION_DATA {
6168 type Message = MavMessage;
6169 const ID: u32 = 148u32;
6170 const NAME: &'static str = "AUTOPILOT_VERSION";
6171 const EXTRA_CRC: u8 = 178u8;
6172 const ENCODED_LEN: usize = 78usize;
6173 fn deser(
6174 _version: MavlinkVersion,
6175 __input: &[u8],
6176 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6177 let avail_len = __input.len();
6178 let mut payload_buf = [0; Self::ENCODED_LEN];
6179 let mut buf = if avail_len < Self::ENCODED_LEN {
6180 payload_buf[0..avail_len].copy_from_slice(__input);
6181 Bytes::new(&payload_buf)
6182 } else {
6183 Bytes::new(__input)
6184 };
6185 let mut __struct = Self::default();
6186 let tmp = buf.get_u64_le();
6187 __struct.capabilities = MavProtocolCapability::from_bits(
6188 tmp & MavProtocolCapability::all().bits(),
6189 )
6190 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6191 flag_type: "MavProtocolCapability",
6192 value: tmp as u32,
6193 })?;
6194 __struct.uid = buf.get_u64_le();
6195 __struct.flight_sw_version = buf.get_u32_le();
6196 __struct.middleware_sw_version = buf.get_u32_le();
6197 __struct.os_sw_version = buf.get_u32_le();
6198 __struct.board_version = buf.get_u32_le();
6199 __struct.vendor_id = buf.get_u16_le();
6200 __struct.product_id = buf.get_u16_le();
6201 for v in &mut __struct.flight_custom_version {
6202 let val = buf.get_u8();
6203 *v = val;
6204 }
6205 for v in &mut __struct.middleware_custom_version {
6206 let val = buf.get_u8();
6207 *v = val;
6208 }
6209 for v in &mut __struct.os_custom_version {
6210 let val = buf.get_u8();
6211 *v = val;
6212 }
6213 for v in &mut __struct.uid2 {
6214 let val = buf.get_u8();
6215 *v = val;
6216 }
6217 Ok(__struct)
6218 }
6219 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6220 let mut __tmp = BytesMut::new(bytes);
6221 #[allow(clippy::absurd_extreme_comparisons)]
6222 #[allow(unused_comparisons)]
6223 if __tmp.remaining() < Self::ENCODED_LEN {
6224 panic!(
6225 "buffer is too small (need {} bytes, but got {})",
6226 Self::ENCODED_LEN,
6227 __tmp.remaining(),
6228 )
6229 }
6230 __tmp.put_u64_le(self.capabilities.bits());
6231 __tmp.put_u64_le(self.uid);
6232 __tmp.put_u32_le(self.flight_sw_version);
6233 __tmp.put_u32_le(self.middleware_sw_version);
6234 __tmp.put_u32_le(self.os_sw_version);
6235 __tmp.put_u32_le(self.board_version);
6236 __tmp.put_u16_le(self.vendor_id);
6237 __tmp.put_u16_le(self.product_id);
6238 for val in &self.flight_custom_version {
6239 __tmp.put_u8(*val);
6240 }
6241 for val in &self.middleware_custom_version {
6242 __tmp.put_u8(*val);
6243 }
6244 for val in &self.os_custom_version {
6245 __tmp.put_u8(*val);
6246 }
6247 if matches!(version, MavlinkVersion::V2) {
6248 for val in &self.uid2 {
6249 __tmp.put_u8(*val);
6250 }
6251 let len = __tmp.len();
6252 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6253 } else {
6254 __tmp.len()
6255 }
6256 }
6257}
6258#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6259#[doc = ""]
6260#[doc = "ID: 435"]
6261#[derive(Debug, Clone, PartialEq)]
6262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6263#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6264#[cfg_attr(feature = "ts", derive(TS))]
6265#[cfg_attr(feature = "ts", ts(export))]
6266pub struct AVAILABLE_MODES_DATA {
6267 #[doc = "A bitfield for use for autopilot-specific flags"]
6268 pub custom_mode: u32,
6269 #[doc = "Mode properties."]
6270 pub properties: MavModeProperty,
6271 #[doc = "The total number of available modes for the current vehicle type."]
6272 pub number_modes: u8,
6273 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6274 pub mode_index: u8,
6275 #[doc = "Standard mode."]
6276 pub standard_mode: MavStandardMode,
6277 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6278 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6279 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6280 pub mode_name: [u8; 35],
6281}
6282impl AVAILABLE_MODES_DATA {
6283 pub const ENCODED_LEN: usize = 46usize;
6284 pub const DEFAULT: Self = Self {
6285 custom_mode: 0_u32,
6286 properties: MavModeProperty::DEFAULT,
6287 number_modes: 0_u8,
6288 mode_index: 0_u8,
6289 standard_mode: MavStandardMode::DEFAULT,
6290 mode_name: [0_u8; 35usize],
6291 };
6292 #[cfg(feature = "arbitrary")]
6293 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6294 use arbitrary::{Arbitrary, Unstructured};
6295 let mut buf = [0u8; 1024];
6296 rng.fill_bytes(&mut buf);
6297 let mut unstructured = Unstructured::new(&buf);
6298 Self::arbitrary(&mut unstructured).unwrap_or_default()
6299 }
6300}
6301impl Default for AVAILABLE_MODES_DATA {
6302 fn default() -> Self {
6303 Self::DEFAULT.clone()
6304 }
6305}
6306impl MessageData for AVAILABLE_MODES_DATA {
6307 type Message = MavMessage;
6308 const ID: u32 = 435u32;
6309 const NAME: &'static str = "AVAILABLE_MODES";
6310 const EXTRA_CRC: u8 = 134u8;
6311 const ENCODED_LEN: usize = 46usize;
6312 fn deser(
6313 _version: MavlinkVersion,
6314 __input: &[u8],
6315 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6316 let avail_len = __input.len();
6317 let mut payload_buf = [0; Self::ENCODED_LEN];
6318 let mut buf = if avail_len < Self::ENCODED_LEN {
6319 payload_buf[0..avail_len].copy_from_slice(__input);
6320 Bytes::new(&payload_buf)
6321 } else {
6322 Bytes::new(__input)
6323 };
6324 let mut __struct = Self::default();
6325 __struct.custom_mode = buf.get_u32_le();
6326 let tmp = buf.get_u32_le();
6327 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6328 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6329 flag_type: "MavModeProperty",
6330 value: tmp as u32,
6331 })?;
6332 __struct.number_modes = buf.get_u8();
6333 __struct.mode_index = buf.get_u8();
6334 let tmp = buf.get_u8();
6335 __struct.standard_mode =
6336 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6337 enum_type: "MavStandardMode",
6338 value: tmp as u32,
6339 })?;
6340 for v in &mut __struct.mode_name {
6341 let val = buf.get_u8();
6342 *v = val;
6343 }
6344 Ok(__struct)
6345 }
6346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6347 let mut __tmp = BytesMut::new(bytes);
6348 #[allow(clippy::absurd_extreme_comparisons)]
6349 #[allow(unused_comparisons)]
6350 if __tmp.remaining() < Self::ENCODED_LEN {
6351 panic!(
6352 "buffer is too small (need {} bytes, but got {})",
6353 Self::ENCODED_LEN,
6354 __tmp.remaining(),
6355 )
6356 }
6357 __tmp.put_u32_le(self.custom_mode);
6358 __tmp.put_u32_le(self.properties.bits());
6359 __tmp.put_u8(self.number_modes);
6360 __tmp.put_u8(self.mode_index);
6361 __tmp.put_u8(self.standard_mode as u8);
6362 for val in &self.mode_name {
6363 __tmp.put_u8(*val);
6364 }
6365 if matches!(version, MavlinkVersion::V2) {
6366 let len = __tmp.len();
6367 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6368 } else {
6369 __tmp.len()
6370 }
6371 }
6372}
6373#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6374#[doc = ""]
6375#[doc = "ID: 437"]
6376#[derive(Debug, Clone, PartialEq)]
6377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6379#[cfg_attr(feature = "ts", derive(TS))]
6380#[cfg_attr(feature = "ts", ts(export))]
6381pub struct AVAILABLE_MODES_MONITOR_DATA {
6382 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6383 pub seq: u8,
6384}
6385impl AVAILABLE_MODES_MONITOR_DATA {
6386 pub const ENCODED_LEN: usize = 1usize;
6387 pub const DEFAULT: Self = Self { seq: 0_u8 };
6388 #[cfg(feature = "arbitrary")]
6389 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6390 use arbitrary::{Arbitrary, Unstructured};
6391 let mut buf = [0u8; 1024];
6392 rng.fill_bytes(&mut buf);
6393 let mut unstructured = Unstructured::new(&buf);
6394 Self::arbitrary(&mut unstructured).unwrap_or_default()
6395 }
6396}
6397impl Default for AVAILABLE_MODES_MONITOR_DATA {
6398 fn default() -> Self {
6399 Self::DEFAULT.clone()
6400 }
6401}
6402impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6403 type Message = MavMessage;
6404 const ID: u32 = 437u32;
6405 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6406 const EXTRA_CRC: u8 = 30u8;
6407 const ENCODED_LEN: usize = 1usize;
6408 fn deser(
6409 _version: MavlinkVersion,
6410 __input: &[u8],
6411 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6412 let avail_len = __input.len();
6413 let mut payload_buf = [0; Self::ENCODED_LEN];
6414 let mut buf = if avail_len < Self::ENCODED_LEN {
6415 payload_buf[0..avail_len].copy_from_slice(__input);
6416 Bytes::new(&payload_buf)
6417 } else {
6418 Bytes::new(__input)
6419 };
6420 let mut __struct = Self::default();
6421 __struct.seq = buf.get_u8();
6422 Ok(__struct)
6423 }
6424 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6425 let mut __tmp = BytesMut::new(bytes);
6426 #[allow(clippy::absurd_extreme_comparisons)]
6427 #[allow(unused_comparisons)]
6428 if __tmp.remaining() < Self::ENCODED_LEN {
6429 panic!(
6430 "buffer is too small (need {} bytes, but got {})",
6431 Self::ENCODED_LEN,
6432 __tmp.remaining(),
6433 )
6434 }
6435 __tmp.put_u8(self.seq);
6436 if matches!(version, MavlinkVersion::V2) {
6437 let len = __tmp.len();
6438 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6439 } else {
6440 __tmp.len()
6441 }
6442 }
6443}
6444#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6445#[doc = ""]
6446#[doc = "ID: 372"]
6447#[derive(Debug, Clone, PartialEq)]
6448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6450#[cfg_attr(feature = "ts", derive(TS))]
6451#[cfg_attr(feature = "ts", ts(export))]
6452pub struct BATTERY_INFO_DATA {
6453 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6454 pub discharge_minimum_voltage: f32,
6455 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6456 pub charging_minimum_voltage: f32,
6457 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6458 pub resting_minimum_voltage: f32,
6459 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6460 pub charging_maximum_voltage: f32,
6461 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6462 pub charging_maximum_current: f32,
6463 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6464 pub nominal_voltage: f32,
6465 #[doc = "Maximum pack discharge current. 0: field not provided."]
6466 pub discharge_maximum_current: f32,
6467 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6468 pub discharge_maximum_burst_current: f32,
6469 #[doc = "Fully charged design capacity. 0: field not provided."]
6470 pub design_capacity: f32,
6471 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6472 pub full_charge_capacity: f32,
6473 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6474 pub cycle_count: u16,
6475 #[doc = "Battery weight. 0: field not provided."]
6476 pub weight: u16,
6477 #[doc = "Battery ID"]
6478 pub id: u8,
6479 #[doc = "Function of the battery."]
6480 pub battery_function: MavBatteryFunction,
6481 #[doc = "Type (chemistry) of the battery."]
6482 pub mavtype: MavBatteryType,
6483 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6484 pub state_of_health: u8,
6485 #[doc = "Number of battery cells in series. 0: field not provided."]
6486 pub cells_in_series: u8,
6487 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6488 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6489 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6490 pub manufacture_date: [u8; 9],
6491 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6492 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6493 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6494 pub serial_number: [u8; 32],
6495 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6496 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6497 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6498 pub name: [u8; 50],
6499}
6500impl BATTERY_INFO_DATA {
6501 pub const ENCODED_LEN: usize = 140usize;
6502 pub const DEFAULT: Self = Self {
6503 discharge_minimum_voltage: 0.0_f32,
6504 charging_minimum_voltage: 0.0_f32,
6505 resting_minimum_voltage: 0.0_f32,
6506 charging_maximum_voltage: 0.0_f32,
6507 charging_maximum_current: 0.0_f32,
6508 nominal_voltage: 0.0_f32,
6509 discharge_maximum_current: 0.0_f32,
6510 discharge_maximum_burst_current: 0.0_f32,
6511 design_capacity: 0.0_f32,
6512 full_charge_capacity: 0.0_f32,
6513 cycle_count: 0_u16,
6514 weight: 0_u16,
6515 id: 0_u8,
6516 battery_function: MavBatteryFunction::DEFAULT,
6517 mavtype: MavBatteryType::DEFAULT,
6518 state_of_health: 0_u8,
6519 cells_in_series: 0_u8,
6520 manufacture_date: [0_u8; 9usize],
6521 serial_number: [0_u8; 32usize],
6522 name: [0_u8; 50usize],
6523 };
6524 #[cfg(feature = "arbitrary")]
6525 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6526 use arbitrary::{Arbitrary, Unstructured};
6527 let mut buf = [0u8; 1024];
6528 rng.fill_bytes(&mut buf);
6529 let mut unstructured = Unstructured::new(&buf);
6530 Self::arbitrary(&mut unstructured).unwrap_or_default()
6531 }
6532}
6533impl Default for BATTERY_INFO_DATA {
6534 fn default() -> Self {
6535 Self::DEFAULT.clone()
6536 }
6537}
6538impl MessageData for BATTERY_INFO_DATA {
6539 type Message = MavMessage;
6540 const ID: u32 = 372u32;
6541 const NAME: &'static str = "BATTERY_INFO";
6542 const EXTRA_CRC: u8 = 26u8;
6543 const ENCODED_LEN: usize = 140usize;
6544 fn deser(
6545 _version: MavlinkVersion,
6546 __input: &[u8],
6547 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6548 let avail_len = __input.len();
6549 let mut payload_buf = [0; Self::ENCODED_LEN];
6550 let mut buf = if avail_len < Self::ENCODED_LEN {
6551 payload_buf[0..avail_len].copy_from_slice(__input);
6552 Bytes::new(&payload_buf)
6553 } else {
6554 Bytes::new(__input)
6555 };
6556 let mut __struct = Self::default();
6557 __struct.discharge_minimum_voltage = buf.get_f32_le();
6558 __struct.charging_minimum_voltage = buf.get_f32_le();
6559 __struct.resting_minimum_voltage = buf.get_f32_le();
6560 __struct.charging_maximum_voltage = buf.get_f32_le();
6561 __struct.charging_maximum_current = buf.get_f32_le();
6562 __struct.nominal_voltage = buf.get_f32_le();
6563 __struct.discharge_maximum_current = buf.get_f32_le();
6564 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6565 __struct.design_capacity = buf.get_f32_le();
6566 __struct.full_charge_capacity = buf.get_f32_le();
6567 __struct.cycle_count = buf.get_u16_le();
6568 __struct.weight = buf.get_u16_le();
6569 __struct.id = buf.get_u8();
6570 let tmp = buf.get_u8();
6571 __struct.battery_function =
6572 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6573 enum_type: "MavBatteryFunction",
6574 value: tmp as u32,
6575 })?;
6576 let tmp = buf.get_u8();
6577 __struct.mavtype =
6578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6579 enum_type: "MavBatteryType",
6580 value: tmp as u32,
6581 })?;
6582 __struct.state_of_health = buf.get_u8();
6583 __struct.cells_in_series = buf.get_u8();
6584 for v in &mut __struct.manufacture_date {
6585 let val = buf.get_u8();
6586 *v = val;
6587 }
6588 for v in &mut __struct.serial_number {
6589 let val = buf.get_u8();
6590 *v = val;
6591 }
6592 for v in &mut __struct.name {
6593 let val = buf.get_u8();
6594 *v = val;
6595 }
6596 Ok(__struct)
6597 }
6598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6599 let mut __tmp = BytesMut::new(bytes);
6600 #[allow(clippy::absurd_extreme_comparisons)]
6601 #[allow(unused_comparisons)]
6602 if __tmp.remaining() < Self::ENCODED_LEN {
6603 panic!(
6604 "buffer is too small (need {} bytes, but got {})",
6605 Self::ENCODED_LEN,
6606 __tmp.remaining(),
6607 )
6608 }
6609 __tmp.put_f32_le(self.discharge_minimum_voltage);
6610 __tmp.put_f32_le(self.charging_minimum_voltage);
6611 __tmp.put_f32_le(self.resting_minimum_voltage);
6612 __tmp.put_f32_le(self.charging_maximum_voltage);
6613 __tmp.put_f32_le(self.charging_maximum_current);
6614 __tmp.put_f32_le(self.nominal_voltage);
6615 __tmp.put_f32_le(self.discharge_maximum_current);
6616 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6617 __tmp.put_f32_le(self.design_capacity);
6618 __tmp.put_f32_le(self.full_charge_capacity);
6619 __tmp.put_u16_le(self.cycle_count);
6620 __tmp.put_u16_le(self.weight);
6621 __tmp.put_u8(self.id);
6622 __tmp.put_u8(self.battery_function as u8);
6623 __tmp.put_u8(self.mavtype as u8);
6624 __tmp.put_u8(self.state_of_health);
6625 __tmp.put_u8(self.cells_in_series);
6626 for val in &self.manufacture_date {
6627 __tmp.put_u8(*val);
6628 }
6629 for val in &self.serial_number {
6630 __tmp.put_u8(*val);
6631 }
6632 for val in &self.name {
6633 __tmp.put_u8(*val);
6634 }
6635 if matches!(version, MavlinkVersion::V2) {
6636 let len = __tmp.len();
6637 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6638 } else {
6639 __tmp.len()
6640 }
6641 }
6642}
6643#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6644#[doc = ""]
6645#[doc = "ID: 147"]
6646#[derive(Debug, Clone, PartialEq)]
6647#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6649#[cfg_attr(feature = "ts", derive(TS))]
6650#[cfg_attr(feature = "ts", ts(export))]
6651pub struct BATTERY_STATUS_DATA {
6652 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6653 pub current_consumed: i32,
6654 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6655 pub energy_consumed: i32,
6656 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6657 pub temperature: i16,
6658 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6659 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6660 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6661 pub voltages: [u16; 10],
6662 #[doc = "Battery current, -1: autopilot does not measure the current"]
6663 pub current_battery: i16,
6664 #[doc = "Battery ID"]
6665 pub id: u8,
6666 #[doc = "Function of the battery"]
6667 pub battery_function: MavBatteryFunction,
6668 #[doc = "Type (chemistry) of the battery"]
6669 pub mavtype: MavBatteryType,
6670 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6671 pub battery_remaining: i8,
6672 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6673 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6674 pub time_remaining: i32,
6675 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6676 #[cfg_attr(feature = "serde", serde(default))]
6677 pub charge_state: MavBatteryChargeState,
6678 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6679 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6680 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6681 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6682 pub voltages_ext: [u16; 4],
6683 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6684 #[cfg_attr(feature = "serde", serde(default))]
6685 pub mode: MavBatteryMode,
6686 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6687 #[cfg_attr(feature = "serde", serde(default))]
6688 pub fault_bitmask: MavBatteryFault,
6689}
6690impl BATTERY_STATUS_DATA {
6691 pub const ENCODED_LEN: usize = 54usize;
6692 pub const DEFAULT: Self = Self {
6693 current_consumed: 0_i32,
6694 energy_consumed: 0_i32,
6695 temperature: 0_i16,
6696 voltages: [0_u16; 10usize],
6697 current_battery: 0_i16,
6698 id: 0_u8,
6699 battery_function: MavBatteryFunction::DEFAULT,
6700 mavtype: MavBatteryType::DEFAULT,
6701 battery_remaining: 0_i8,
6702 time_remaining: 0_i32,
6703 charge_state: MavBatteryChargeState::DEFAULT,
6704 voltages_ext: [0_u16; 4usize],
6705 mode: MavBatteryMode::DEFAULT,
6706 fault_bitmask: MavBatteryFault::DEFAULT,
6707 };
6708 #[cfg(feature = "arbitrary")]
6709 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6710 use arbitrary::{Arbitrary, Unstructured};
6711 let mut buf = [0u8; 1024];
6712 rng.fill_bytes(&mut buf);
6713 let mut unstructured = Unstructured::new(&buf);
6714 Self::arbitrary(&mut unstructured).unwrap_or_default()
6715 }
6716}
6717impl Default for BATTERY_STATUS_DATA {
6718 fn default() -> Self {
6719 Self::DEFAULT.clone()
6720 }
6721}
6722impl MessageData for BATTERY_STATUS_DATA {
6723 type Message = MavMessage;
6724 const ID: u32 = 147u32;
6725 const NAME: &'static str = "BATTERY_STATUS";
6726 const EXTRA_CRC: u8 = 154u8;
6727 const ENCODED_LEN: usize = 54usize;
6728 fn deser(
6729 _version: MavlinkVersion,
6730 __input: &[u8],
6731 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6732 let avail_len = __input.len();
6733 let mut payload_buf = [0; Self::ENCODED_LEN];
6734 let mut buf = if avail_len < Self::ENCODED_LEN {
6735 payload_buf[0..avail_len].copy_from_slice(__input);
6736 Bytes::new(&payload_buf)
6737 } else {
6738 Bytes::new(__input)
6739 };
6740 let mut __struct = Self::default();
6741 __struct.current_consumed = buf.get_i32_le();
6742 __struct.energy_consumed = buf.get_i32_le();
6743 __struct.temperature = buf.get_i16_le();
6744 for v in &mut __struct.voltages {
6745 let val = buf.get_u16_le();
6746 *v = val;
6747 }
6748 __struct.current_battery = buf.get_i16_le();
6749 __struct.id = buf.get_u8();
6750 let tmp = buf.get_u8();
6751 __struct.battery_function =
6752 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6753 enum_type: "MavBatteryFunction",
6754 value: tmp as u32,
6755 })?;
6756 let tmp = buf.get_u8();
6757 __struct.mavtype =
6758 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6759 enum_type: "MavBatteryType",
6760 value: tmp as u32,
6761 })?;
6762 __struct.battery_remaining = buf.get_i8();
6763 __struct.time_remaining = buf.get_i32_le();
6764 let tmp = buf.get_u8();
6765 __struct.charge_state =
6766 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6767 enum_type: "MavBatteryChargeState",
6768 value: tmp as u32,
6769 })?;
6770 for v in &mut __struct.voltages_ext {
6771 let val = buf.get_u16_le();
6772 *v = val;
6773 }
6774 let tmp = buf.get_u8();
6775 __struct.mode =
6776 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6777 enum_type: "MavBatteryMode",
6778 value: tmp as u32,
6779 })?;
6780 let tmp = buf.get_u32_le();
6781 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6782 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6783 flag_type: "MavBatteryFault",
6784 value: tmp as u32,
6785 })?;
6786 Ok(__struct)
6787 }
6788 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6789 let mut __tmp = BytesMut::new(bytes);
6790 #[allow(clippy::absurd_extreme_comparisons)]
6791 #[allow(unused_comparisons)]
6792 if __tmp.remaining() < Self::ENCODED_LEN {
6793 panic!(
6794 "buffer is too small (need {} bytes, but got {})",
6795 Self::ENCODED_LEN,
6796 __tmp.remaining(),
6797 )
6798 }
6799 __tmp.put_i32_le(self.current_consumed);
6800 __tmp.put_i32_le(self.energy_consumed);
6801 __tmp.put_i16_le(self.temperature);
6802 for val in &self.voltages {
6803 __tmp.put_u16_le(*val);
6804 }
6805 __tmp.put_i16_le(self.current_battery);
6806 __tmp.put_u8(self.id);
6807 __tmp.put_u8(self.battery_function as u8);
6808 __tmp.put_u8(self.mavtype as u8);
6809 __tmp.put_i8(self.battery_remaining);
6810 if matches!(version, MavlinkVersion::V2) {
6811 __tmp.put_i32_le(self.time_remaining);
6812 __tmp.put_u8(self.charge_state as u8);
6813 for val in &self.voltages_ext {
6814 __tmp.put_u16_le(*val);
6815 }
6816 __tmp.put_u8(self.mode as u8);
6817 __tmp.put_u32_le(self.fault_bitmask.bits());
6818 let len = __tmp.len();
6819 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6820 } else {
6821 __tmp.len()
6822 }
6823 }
6824}
6825#[doc = "Report button state change."]
6826#[doc = ""]
6827#[doc = "ID: 257"]
6828#[derive(Debug, Clone, PartialEq)]
6829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6831#[cfg_attr(feature = "ts", derive(TS))]
6832#[cfg_attr(feature = "ts", ts(export))]
6833pub struct BUTTON_CHANGE_DATA {
6834 #[doc = "Timestamp (time since system boot)."]
6835 pub time_boot_ms: u32,
6836 #[doc = "Time of last change of button state."]
6837 pub last_change_ms: u32,
6838 #[doc = "Bitmap for state of buttons."]
6839 pub state: u8,
6840}
6841impl BUTTON_CHANGE_DATA {
6842 pub const ENCODED_LEN: usize = 9usize;
6843 pub const DEFAULT: Self = Self {
6844 time_boot_ms: 0_u32,
6845 last_change_ms: 0_u32,
6846 state: 0_u8,
6847 };
6848 #[cfg(feature = "arbitrary")]
6849 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6850 use arbitrary::{Arbitrary, Unstructured};
6851 let mut buf = [0u8; 1024];
6852 rng.fill_bytes(&mut buf);
6853 let mut unstructured = Unstructured::new(&buf);
6854 Self::arbitrary(&mut unstructured).unwrap_or_default()
6855 }
6856}
6857impl Default for BUTTON_CHANGE_DATA {
6858 fn default() -> Self {
6859 Self::DEFAULT.clone()
6860 }
6861}
6862impl MessageData for BUTTON_CHANGE_DATA {
6863 type Message = MavMessage;
6864 const ID: u32 = 257u32;
6865 const NAME: &'static str = "BUTTON_CHANGE";
6866 const EXTRA_CRC: u8 = 131u8;
6867 const ENCODED_LEN: usize = 9usize;
6868 fn deser(
6869 _version: MavlinkVersion,
6870 __input: &[u8],
6871 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6872 let avail_len = __input.len();
6873 let mut payload_buf = [0; Self::ENCODED_LEN];
6874 let mut buf = if avail_len < Self::ENCODED_LEN {
6875 payload_buf[0..avail_len].copy_from_slice(__input);
6876 Bytes::new(&payload_buf)
6877 } else {
6878 Bytes::new(__input)
6879 };
6880 let mut __struct = Self::default();
6881 __struct.time_boot_ms = buf.get_u32_le();
6882 __struct.last_change_ms = buf.get_u32_le();
6883 __struct.state = buf.get_u8();
6884 Ok(__struct)
6885 }
6886 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6887 let mut __tmp = BytesMut::new(bytes);
6888 #[allow(clippy::absurd_extreme_comparisons)]
6889 #[allow(unused_comparisons)]
6890 if __tmp.remaining() < Self::ENCODED_LEN {
6891 panic!(
6892 "buffer is too small (need {} bytes, but got {})",
6893 Self::ENCODED_LEN,
6894 __tmp.remaining(),
6895 )
6896 }
6897 __tmp.put_u32_le(self.time_boot_ms);
6898 __tmp.put_u32_le(self.last_change_ms);
6899 __tmp.put_u8(self.state);
6900 if matches!(version, MavlinkVersion::V2) {
6901 let len = __tmp.len();
6902 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6903 } else {
6904 __tmp.len()
6905 }
6906 }
6907}
6908#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6909#[doc = ""]
6910#[doc = "ID: 262"]
6911#[derive(Debug, Clone, PartialEq)]
6912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6914#[cfg_attr(feature = "ts", derive(TS))]
6915#[cfg_attr(feature = "ts", ts(export))]
6916pub struct CAMERA_CAPTURE_STATUS_DATA {
6917 #[doc = "Timestamp (time since system boot)."]
6918 pub time_boot_ms: u32,
6919 #[doc = "Image capture interval"]
6920 pub image_interval: f32,
6921 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6922 pub recording_time_ms: u32,
6923 #[doc = "Available storage capacity."]
6924 pub available_capacity: f32,
6925 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6926 pub image_status: u8,
6927 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6928 pub video_status: u8,
6929 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6930 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6931 pub image_count: i32,
6932 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6933 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6934 pub camera_device_id: u8,
6935}
6936impl CAMERA_CAPTURE_STATUS_DATA {
6937 pub const ENCODED_LEN: usize = 23usize;
6938 pub const DEFAULT: Self = Self {
6939 time_boot_ms: 0_u32,
6940 image_interval: 0.0_f32,
6941 recording_time_ms: 0_u32,
6942 available_capacity: 0.0_f32,
6943 image_status: 0_u8,
6944 video_status: 0_u8,
6945 image_count: 0_i32,
6946 camera_device_id: 0_u8,
6947 };
6948 #[cfg(feature = "arbitrary")]
6949 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6950 use arbitrary::{Arbitrary, Unstructured};
6951 let mut buf = [0u8; 1024];
6952 rng.fill_bytes(&mut buf);
6953 let mut unstructured = Unstructured::new(&buf);
6954 Self::arbitrary(&mut unstructured).unwrap_or_default()
6955 }
6956}
6957impl Default for CAMERA_CAPTURE_STATUS_DATA {
6958 fn default() -> Self {
6959 Self::DEFAULT.clone()
6960 }
6961}
6962impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6963 type Message = MavMessage;
6964 const ID: u32 = 262u32;
6965 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6966 const EXTRA_CRC: u8 = 12u8;
6967 const ENCODED_LEN: usize = 23usize;
6968 fn deser(
6969 _version: MavlinkVersion,
6970 __input: &[u8],
6971 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6972 let avail_len = __input.len();
6973 let mut payload_buf = [0; Self::ENCODED_LEN];
6974 let mut buf = if avail_len < Self::ENCODED_LEN {
6975 payload_buf[0..avail_len].copy_from_slice(__input);
6976 Bytes::new(&payload_buf)
6977 } else {
6978 Bytes::new(__input)
6979 };
6980 let mut __struct = Self::default();
6981 __struct.time_boot_ms = buf.get_u32_le();
6982 __struct.image_interval = buf.get_f32_le();
6983 __struct.recording_time_ms = buf.get_u32_le();
6984 __struct.available_capacity = buf.get_f32_le();
6985 __struct.image_status = buf.get_u8();
6986 __struct.video_status = buf.get_u8();
6987 __struct.image_count = buf.get_i32_le();
6988 __struct.camera_device_id = buf.get_u8();
6989 Ok(__struct)
6990 }
6991 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6992 let mut __tmp = BytesMut::new(bytes);
6993 #[allow(clippy::absurd_extreme_comparisons)]
6994 #[allow(unused_comparisons)]
6995 if __tmp.remaining() < Self::ENCODED_LEN {
6996 panic!(
6997 "buffer is too small (need {} bytes, but got {})",
6998 Self::ENCODED_LEN,
6999 __tmp.remaining(),
7000 )
7001 }
7002 __tmp.put_u32_le(self.time_boot_ms);
7003 __tmp.put_f32_le(self.image_interval);
7004 __tmp.put_u32_le(self.recording_time_ms);
7005 __tmp.put_f32_le(self.available_capacity);
7006 __tmp.put_u8(self.image_status);
7007 __tmp.put_u8(self.video_status);
7008 if matches!(version, MavlinkVersion::V2) {
7009 __tmp.put_i32_le(self.image_count);
7010 __tmp.put_u8(self.camera_device_id);
7011 let len = __tmp.len();
7012 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7013 } else {
7014 __tmp.len()
7015 }
7016 }
7017}
7018#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7019#[doc = ""]
7020#[doc = "ID: 271"]
7021#[derive(Debug, Clone, PartialEq)]
7022#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7023#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7024#[cfg_attr(feature = "ts", derive(TS))]
7025#[cfg_attr(feature = "ts", ts(export))]
7026pub struct CAMERA_FOV_STATUS_DATA {
7027 #[doc = "Timestamp (time since system boot)."]
7028 pub time_boot_ms: u32,
7029 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7030 pub lat_camera: i32,
7031 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7032 pub lon_camera: i32,
7033 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7034 pub alt_camera: i32,
7035 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7036 pub lat_image: i32,
7037 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7038 pub lon_image: i32,
7039 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7040 pub alt_image: i32,
7041 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7042 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7043 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7044 pub q: [f32; 4],
7045 #[doc = "Horizontal field of view (NaN if unknown)."]
7046 pub hfov: f32,
7047 #[doc = "Vertical field of view (NaN if unknown)."]
7048 pub vfov: f32,
7049 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7050 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7051 pub camera_device_id: u8,
7052}
7053impl CAMERA_FOV_STATUS_DATA {
7054 pub const ENCODED_LEN: usize = 53usize;
7055 pub const DEFAULT: Self = Self {
7056 time_boot_ms: 0_u32,
7057 lat_camera: 0_i32,
7058 lon_camera: 0_i32,
7059 alt_camera: 0_i32,
7060 lat_image: 0_i32,
7061 lon_image: 0_i32,
7062 alt_image: 0_i32,
7063 q: [0.0_f32; 4usize],
7064 hfov: 0.0_f32,
7065 vfov: 0.0_f32,
7066 camera_device_id: 0_u8,
7067 };
7068 #[cfg(feature = "arbitrary")]
7069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7070 use arbitrary::{Arbitrary, Unstructured};
7071 let mut buf = [0u8; 1024];
7072 rng.fill_bytes(&mut buf);
7073 let mut unstructured = Unstructured::new(&buf);
7074 Self::arbitrary(&mut unstructured).unwrap_or_default()
7075 }
7076}
7077impl Default for CAMERA_FOV_STATUS_DATA {
7078 fn default() -> Self {
7079 Self::DEFAULT.clone()
7080 }
7081}
7082impl MessageData for CAMERA_FOV_STATUS_DATA {
7083 type Message = MavMessage;
7084 const ID: u32 = 271u32;
7085 const NAME: &'static str = "CAMERA_FOV_STATUS";
7086 const EXTRA_CRC: u8 = 22u8;
7087 const ENCODED_LEN: usize = 53usize;
7088 fn deser(
7089 _version: MavlinkVersion,
7090 __input: &[u8],
7091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7092 let avail_len = __input.len();
7093 let mut payload_buf = [0; Self::ENCODED_LEN];
7094 let mut buf = if avail_len < Self::ENCODED_LEN {
7095 payload_buf[0..avail_len].copy_from_slice(__input);
7096 Bytes::new(&payload_buf)
7097 } else {
7098 Bytes::new(__input)
7099 };
7100 let mut __struct = Self::default();
7101 __struct.time_boot_ms = buf.get_u32_le();
7102 __struct.lat_camera = buf.get_i32_le();
7103 __struct.lon_camera = buf.get_i32_le();
7104 __struct.alt_camera = buf.get_i32_le();
7105 __struct.lat_image = buf.get_i32_le();
7106 __struct.lon_image = buf.get_i32_le();
7107 __struct.alt_image = buf.get_i32_le();
7108 for v in &mut __struct.q {
7109 let val = buf.get_f32_le();
7110 *v = val;
7111 }
7112 __struct.hfov = buf.get_f32_le();
7113 __struct.vfov = buf.get_f32_le();
7114 __struct.camera_device_id = buf.get_u8();
7115 Ok(__struct)
7116 }
7117 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7118 let mut __tmp = BytesMut::new(bytes);
7119 #[allow(clippy::absurd_extreme_comparisons)]
7120 #[allow(unused_comparisons)]
7121 if __tmp.remaining() < Self::ENCODED_LEN {
7122 panic!(
7123 "buffer is too small (need {} bytes, but got {})",
7124 Self::ENCODED_LEN,
7125 __tmp.remaining(),
7126 )
7127 }
7128 __tmp.put_u32_le(self.time_boot_ms);
7129 __tmp.put_i32_le(self.lat_camera);
7130 __tmp.put_i32_le(self.lon_camera);
7131 __tmp.put_i32_le(self.alt_camera);
7132 __tmp.put_i32_le(self.lat_image);
7133 __tmp.put_i32_le(self.lon_image);
7134 __tmp.put_i32_le(self.alt_image);
7135 for val in &self.q {
7136 __tmp.put_f32_le(*val);
7137 }
7138 __tmp.put_f32_le(self.hfov);
7139 __tmp.put_f32_le(self.vfov);
7140 if matches!(version, MavlinkVersion::V2) {
7141 __tmp.put_u8(self.camera_device_id);
7142 let len = __tmp.len();
7143 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7144 } else {
7145 __tmp.len()
7146 }
7147 }
7148}
7149#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7150#[doc = ""]
7151#[doc = "ID: 263"]
7152#[derive(Debug, Clone, PartialEq)]
7153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7155#[cfg_attr(feature = "ts", derive(TS))]
7156#[cfg_attr(feature = "ts", ts(export))]
7157pub struct CAMERA_IMAGE_CAPTURED_DATA {
7158 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7159 pub time_utc: u64,
7160 #[doc = "Timestamp (time since system boot)."]
7161 pub time_boot_ms: u32,
7162 #[doc = "Latitude where image was taken"]
7163 pub lat: i32,
7164 #[doc = "Longitude where capture was taken"]
7165 pub lon: i32,
7166 #[doc = "Altitude (MSL) where image was taken"]
7167 pub alt: i32,
7168 #[doc = "Altitude above ground"]
7169 pub relative_alt: i32,
7170 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7171 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7172 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7173 pub q: [f32; 4],
7174 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7175 pub image_index: i32,
7176 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7177 pub camera_id: u8,
7178 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7179 pub capture_result: i8,
7180 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7181 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7182 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7183 pub file_url: [u8; 205],
7184}
7185impl CAMERA_IMAGE_CAPTURED_DATA {
7186 pub const ENCODED_LEN: usize = 255usize;
7187 pub const DEFAULT: Self = Self {
7188 time_utc: 0_u64,
7189 time_boot_ms: 0_u32,
7190 lat: 0_i32,
7191 lon: 0_i32,
7192 alt: 0_i32,
7193 relative_alt: 0_i32,
7194 q: [0.0_f32; 4usize],
7195 image_index: 0_i32,
7196 camera_id: 0_u8,
7197 capture_result: 0_i8,
7198 file_url: [0_u8; 205usize],
7199 };
7200 #[cfg(feature = "arbitrary")]
7201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7202 use arbitrary::{Arbitrary, Unstructured};
7203 let mut buf = [0u8; 1024];
7204 rng.fill_bytes(&mut buf);
7205 let mut unstructured = Unstructured::new(&buf);
7206 Self::arbitrary(&mut unstructured).unwrap_or_default()
7207 }
7208}
7209impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7210 fn default() -> Self {
7211 Self::DEFAULT.clone()
7212 }
7213}
7214impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7215 type Message = MavMessage;
7216 const ID: u32 = 263u32;
7217 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7218 const EXTRA_CRC: u8 = 133u8;
7219 const ENCODED_LEN: usize = 255usize;
7220 fn deser(
7221 _version: MavlinkVersion,
7222 __input: &[u8],
7223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7224 let avail_len = __input.len();
7225 let mut payload_buf = [0; Self::ENCODED_LEN];
7226 let mut buf = if avail_len < Self::ENCODED_LEN {
7227 payload_buf[0..avail_len].copy_from_slice(__input);
7228 Bytes::new(&payload_buf)
7229 } else {
7230 Bytes::new(__input)
7231 };
7232 let mut __struct = Self::default();
7233 __struct.time_utc = buf.get_u64_le();
7234 __struct.time_boot_ms = buf.get_u32_le();
7235 __struct.lat = buf.get_i32_le();
7236 __struct.lon = buf.get_i32_le();
7237 __struct.alt = buf.get_i32_le();
7238 __struct.relative_alt = buf.get_i32_le();
7239 for v in &mut __struct.q {
7240 let val = buf.get_f32_le();
7241 *v = val;
7242 }
7243 __struct.image_index = buf.get_i32_le();
7244 __struct.camera_id = buf.get_u8();
7245 __struct.capture_result = buf.get_i8();
7246 for v in &mut __struct.file_url {
7247 let val = buf.get_u8();
7248 *v = val;
7249 }
7250 Ok(__struct)
7251 }
7252 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7253 let mut __tmp = BytesMut::new(bytes);
7254 #[allow(clippy::absurd_extreme_comparisons)]
7255 #[allow(unused_comparisons)]
7256 if __tmp.remaining() < Self::ENCODED_LEN {
7257 panic!(
7258 "buffer is too small (need {} bytes, but got {})",
7259 Self::ENCODED_LEN,
7260 __tmp.remaining(),
7261 )
7262 }
7263 __tmp.put_u64_le(self.time_utc);
7264 __tmp.put_u32_le(self.time_boot_ms);
7265 __tmp.put_i32_le(self.lat);
7266 __tmp.put_i32_le(self.lon);
7267 __tmp.put_i32_le(self.alt);
7268 __tmp.put_i32_le(self.relative_alt);
7269 for val in &self.q {
7270 __tmp.put_f32_le(*val);
7271 }
7272 __tmp.put_i32_le(self.image_index);
7273 __tmp.put_u8(self.camera_id);
7274 __tmp.put_i8(self.capture_result);
7275 for val in &self.file_url {
7276 __tmp.put_u8(*val);
7277 }
7278 if matches!(version, MavlinkVersion::V2) {
7279 let len = __tmp.len();
7280 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7281 } else {
7282 __tmp.len()
7283 }
7284 }
7285}
7286#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7287#[doc = ""]
7288#[doc = "ID: 259"]
7289#[derive(Debug, Clone, PartialEq)]
7290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7292#[cfg_attr(feature = "ts", derive(TS))]
7293#[cfg_attr(feature = "ts", ts(export))]
7294pub struct CAMERA_INFORMATION_DATA {
7295 #[doc = "Timestamp (time since system boot)."]
7296 pub time_boot_ms: u32,
7297 #[doc = "0xff). Use 0 if not known."]
7298 pub firmware_version: u32,
7299 #[doc = "Focal length. Use NaN if not known."]
7300 pub focal_length: f32,
7301 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7302 pub sensor_size_h: f32,
7303 #[doc = "Image sensor size vertical. Use NaN if not known."]
7304 pub sensor_size_v: f32,
7305 #[doc = "Bitmap of camera capability flags."]
7306 pub flags: CameraCapFlags,
7307 #[doc = "Horizontal image resolution. Use 0 if not known."]
7308 pub resolution_h: u16,
7309 #[doc = "Vertical image resolution. Use 0 if not known."]
7310 pub resolution_v: u16,
7311 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7312 pub cam_definition_version: u16,
7313 #[doc = "Name of the camera vendor"]
7314 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7315 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7316 pub vendor_name: [u8; 32],
7317 #[doc = "Name of the camera model"]
7318 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7319 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7320 pub model_name: [u8; 32],
7321 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7322 pub lens_id: u8,
7323 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7324 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7325 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7326 pub cam_definition_uri: [u8; 140],
7327 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7329 pub gimbal_device_id: u8,
7330 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7331 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7332 pub camera_device_id: u8,
7333}
7334impl CAMERA_INFORMATION_DATA {
7335 pub const ENCODED_LEN: usize = 237usize;
7336 pub const DEFAULT: Self = Self {
7337 time_boot_ms: 0_u32,
7338 firmware_version: 0_u32,
7339 focal_length: 0.0_f32,
7340 sensor_size_h: 0.0_f32,
7341 sensor_size_v: 0.0_f32,
7342 flags: CameraCapFlags::DEFAULT,
7343 resolution_h: 0_u16,
7344 resolution_v: 0_u16,
7345 cam_definition_version: 0_u16,
7346 vendor_name: [0_u8; 32usize],
7347 model_name: [0_u8; 32usize],
7348 lens_id: 0_u8,
7349 cam_definition_uri: [0_u8; 140usize],
7350 gimbal_device_id: 0_u8,
7351 camera_device_id: 0_u8,
7352 };
7353 #[cfg(feature = "arbitrary")]
7354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7355 use arbitrary::{Arbitrary, Unstructured};
7356 let mut buf = [0u8; 1024];
7357 rng.fill_bytes(&mut buf);
7358 let mut unstructured = Unstructured::new(&buf);
7359 Self::arbitrary(&mut unstructured).unwrap_or_default()
7360 }
7361}
7362impl Default for CAMERA_INFORMATION_DATA {
7363 fn default() -> Self {
7364 Self::DEFAULT.clone()
7365 }
7366}
7367impl MessageData for CAMERA_INFORMATION_DATA {
7368 type Message = MavMessage;
7369 const ID: u32 = 259u32;
7370 const NAME: &'static str = "CAMERA_INFORMATION";
7371 const EXTRA_CRC: u8 = 92u8;
7372 const ENCODED_LEN: usize = 237usize;
7373 fn deser(
7374 _version: MavlinkVersion,
7375 __input: &[u8],
7376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7377 let avail_len = __input.len();
7378 let mut payload_buf = [0; Self::ENCODED_LEN];
7379 let mut buf = if avail_len < Self::ENCODED_LEN {
7380 payload_buf[0..avail_len].copy_from_slice(__input);
7381 Bytes::new(&payload_buf)
7382 } else {
7383 Bytes::new(__input)
7384 };
7385 let mut __struct = Self::default();
7386 __struct.time_boot_ms = buf.get_u32_le();
7387 __struct.firmware_version = buf.get_u32_le();
7388 __struct.focal_length = buf.get_f32_le();
7389 __struct.sensor_size_h = buf.get_f32_le();
7390 __struct.sensor_size_v = buf.get_f32_le();
7391 let tmp = buf.get_u32_le();
7392 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7393 ::mavlink_core::error::ParserError::InvalidFlag {
7394 flag_type: "CameraCapFlags",
7395 value: tmp as u32,
7396 },
7397 )?;
7398 __struct.resolution_h = buf.get_u16_le();
7399 __struct.resolution_v = buf.get_u16_le();
7400 __struct.cam_definition_version = buf.get_u16_le();
7401 for v in &mut __struct.vendor_name {
7402 let val = buf.get_u8();
7403 *v = val;
7404 }
7405 for v in &mut __struct.model_name {
7406 let val = buf.get_u8();
7407 *v = val;
7408 }
7409 __struct.lens_id = buf.get_u8();
7410 for v in &mut __struct.cam_definition_uri {
7411 let val = buf.get_u8();
7412 *v = val;
7413 }
7414 __struct.gimbal_device_id = buf.get_u8();
7415 __struct.camera_device_id = buf.get_u8();
7416 Ok(__struct)
7417 }
7418 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7419 let mut __tmp = BytesMut::new(bytes);
7420 #[allow(clippy::absurd_extreme_comparisons)]
7421 #[allow(unused_comparisons)]
7422 if __tmp.remaining() < Self::ENCODED_LEN {
7423 panic!(
7424 "buffer is too small (need {} bytes, but got {})",
7425 Self::ENCODED_LEN,
7426 __tmp.remaining(),
7427 )
7428 }
7429 __tmp.put_u32_le(self.time_boot_ms);
7430 __tmp.put_u32_le(self.firmware_version);
7431 __tmp.put_f32_le(self.focal_length);
7432 __tmp.put_f32_le(self.sensor_size_h);
7433 __tmp.put_f32_le(self.sensor_size_v);
7434 __tmp.put_u32_le(self.flags.bits());
7435 __tmp.put_u16_le(self.resolution_h);
7436 __tmp.put_u16_le(self.resolution_v);
7437 __tmp.put_u16_le(self.cam_definition_version);
7438 for val in &self.vendor_name {
7439 __tmp.put_u8(*val);
7440 }
7441 for val in &self.model_name {
7442 __tmp.put_u8(*val);
7443 }
7444 __tmp.put_u8(self.lens_id);
7445 for val in &self.cam_definition_uri {
7446 __tmp.put_u8(*val);
7447 }
7448 if matches!(version, MavlinkVersion::V2) {
7449 __tmp.put_u8(self.gimbal_device_id);
7450 __tmp.put_u8(self.camera_device_id);
7451 let len = __tmp.len();
7452 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7453 } else {
7454 __tmp.len()
7455 }
7456 }
7457}
7458#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7459#[doc = ""]
7460#[doc = "ID: 260"]
7461#[derive(Debug, Clone, PartialEq)]
7462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7463#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7464#[cfg_attr(feature = "ts", derive(TS))]
7465#[cfg_attr(feature = "ts", ts(export))]
7466pub struct CAMERA_SETTINGS_DATA {
7467 #[doc = "Timestamp (time since system boot)."]
7468 pub time_boot_ms: u32,
7469 #[doc = "Camera mode"]
7470 pub mode_id: CameraMode,
7471 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7472 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7473 pub zoomLevel: f32,
7474 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7475 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7476 pub focusLevel: f32,
7477 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7478 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7479 pub camera_device_id: u8,
7480}
7481impl CAMERA_SETTINGS_DATA {
7482 pub const ENCODED_LEN: usize = 14usize;
7483 pub const DEFAULT: Self = Self {
7484 time_boot_ms: 0_u32,
7485 mode_id: CameraMode::DEFAULT,
7486 zoomLevel: 0.0_f32,
7487 focusLevel: 0.0_f32,
7488 camera_device_id: 0_u8,
7489 };
7490 #[cfg(feature = "arbitrary")]
7491 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7492 use arbitrary::{Arbitrary, Unstructured};
7493 let mut buf = [0u8; 1024];
7494 rng.fill_bytes(&mut buf);
7495 let mut unstructured = Unstructured::new(&buf);
7496 Self::arbitrary(&mut unstructured).unwrap_or_default()
7497 }
7498}
7499impl Default for CAMERA_SETTINGS_DATA {
7500 fn default() -> Self {
7501 Self::DEFAULT.clone()
7502 }
7503}
7504impl MessageData for CAMERA_SETTINGS_DATA {
7505 type Message = MavMessage;
7506 const ID: u32 = 260u32;
7507 const NAME: &'static str = "CAMERA_SETTINGS";
7508 const EXTRA_CRC: u8 = 146u8;
7509 const ENCODED_LEN: usize = 14usize;
7510 fn deser(
7511 _version: MavlinkVersion,
7512 __input: &[u8],
7513 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7514 let avail_len = __input.len();
7515 let mut payload_buf = [0; Self::ENCODED_LEN];
7516 let mut buf = if avail_len < Self::ENCODED_LEN {
7517 payload_buf[0..avail_len].copy_from_slice(__input);
7518 Bytes::new(&payload_buf)
7519 } else {
7520 Bytes::new(__input)
7521 };
7522 let mut __struct = Self::default();
7523 __struct.time_boot_ms = buf.get_u32_le();
7524 let tmp = buf.get_u8();
7525 __struct.mode_id =
7526 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7527 enum_type: "CameraMode",
7528 value: tmp as u32,
7529 })?;
7530 __struct.zoomLevel = buf.get_f32_le();
7531 __struct.focusLevel = buf.get_f32_le();
7532 __struct.camera_device_id = buf.get_u8();
7533 Ok(__struct)
7534 }
7535 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7536 let mut __tmp = BytesMut::new(bytes);
7537 #[allow(clippy::absurd_extreme_comparisons)]
7538 #[allow(unused_comparisons)]
7539 if __tmp.remaining() < Self::ENCODED_LEN {
7540 panic!(
7541 "buffer is too small (need {} bytes, but got {})",
7542 Self::ENCODED_LEN,
7543 __tmp.remaining(),
7544 )
7545 }
7546 __tmp.put_u32_le(self.time_boot_ms);
7547 __tmp.put_u8(self.mode_id as u8);
7548 if matches!(version, MavlinkVersion::V2) {
7549 __tmp.put_f32_le(self.zoomLevel);
7550 __tmp.put_f32_le(self.focusLevel);
7551 __tmp.put_u8(self.camera_device_id);
7552 let len = __tmp.len();
7553 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7554 } else {
7555 __tmp.len()
7556 }
7557 }
7558}
7559#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7560#[doc = ""]
7561#[doc = "ID: 277"]
7562#[derive(Debug, Clone, PartialEq)]
7563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7565#[cfg_attr(feature = "ts", derive(TS))]
7566#[cfg_attr(feature = "ts", ts(export))]
7567pub struct CAMERA_THERMAL_RANGE_DATA {
7568 #[doc = "Timestamp (time since system boot)."]
7569 pub time_boot_ms: u32,
7570 #[doc = "Temperature max."]
7571 pub max: f32,
7572 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7573 pub max_point_x: f32,
7574 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7575 pub max_point_y: f32,
7576 #[doc = "Temperature min."]
7577 pub min: f32,
7578 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7579 pub min_point_x: f32,
7580 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7581 pub min_point_y: f32,
7582 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7583 pub stream_id: u8,
7584 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7585 pub camera_device_id: u8,
7586}
7587impl CAMERA_THERMAL_RANGE_DATA {
7588 pub const ENCODED_LEN: usize = 30usize;
7589 pub const DEFAULT: Self = Self {
7590 time_boot_ms: 0_u32,
7591 max: 0.0_f32,
7592 max_point_x: 0.0_f32,
7593 max_point_y: 0.0_f32,
7594 min: 0.0_f32,
7595 min_point_x: 0.0_f32,
7596 min_point_y: 0.0_f32,
7597 stream_id: 0_u8,
7598 camera_device_id: 0_u8,
7599 };
7600 #[cfg(feature = "arbitrary")]
7601 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7602 use arbitrary::{Arbitrary, Unstructured};
7603 let mut buf = [0u8; 1024];
7604 rng.fill_bytes(&mut buf);
7605 let mut unstructured = Unstructured::new(&buf);
7606 Self::arbitrary(&mut unstructured).unwrap_or_default()
7607 }
7608}
7609impl Default for CAMERA_THERMAL_RANGE_DATA {
7610 fn default() -> Self {
7611 Self::DEFAULT.clone()
7612 }
7613}
7614impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7615 type Message = MavMessage;
7616 const ID: u32 = 277u32;
7617 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7618 const EXTRA_CRC: u8 = 62u8;
7619 const ENCODED_LEN: usize = 30usize;
7620 fn deser(
7621 _version: MavlinkVersion,
7622 __input: &[u8],
7623 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7624 let avail_len = __input.len();
7625 let mut payload_buf = [0; Self::ENCODED_LEN];
7626 let mut buf = if avail_len < Self::ENCODED_LEN {
7627 payload_buf[0..avail_len].copy_from_slice(__input);
7628 Bytes::new(&payload_buf)
7629 } else {
7630 Bytes::new(__input)
7631 };
7632 let mut __struct = Self::default();
7633 __struct.time_boot_ms = buf.get_u32_le();
7634 __struct.max = buf.get_f32_le();
7635 __struct.max_point_x = buf.get_f32_le();
7636 __struct.max_point_y = buf.get_f32_le();
7637 __struct.min = buf.get_f32_le();
7638 __struct.min_point_x = buf.get_f32_le();
7639 __struct.min_point_y = buf.get_f32_le();
7640 __struct.stream_id = buf.get_u8();
7641 __struct.camera_device_id = buf.get_u8();
7642 Ok(__struct)
7643 }
7644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7645 let mut __tmp = BytesMut::new(bytes);
7646 #[allow(clippy::absurd_extreme_comparisons)]
7647 #[allow(unused_comparisons)]
7648 if __tmp.remaining() < Self::ENCODED_LEN {
7649 panic!(
7650 "buffer is too small (need {} bytes, but got {})",
7651 Self::ENCODED_LEN,
7652 __tmp.remaining(),
7653 )
7654 }
7655 __tmp.put_u32_le(self.time_boot_ms);
7656 __tmp.put_f32_le(self.max);
7657 __tmp.put_f32_le(self.max_point_x);
7658 __tmp.put_f32_le(self.max_point_y);
7659 __tmp.put_f32_le(self.min);
7660 __tmp.put_f32_le(self.min_point_x);
7661 __tmp.put_f32_le(self.min_point_y);
7662 __tmp.put_u8(self.stream_id);
7663 __tmp.put_u8(self.camera_device_id);
7664 if matches!(version, MavlinkVersion::V2) {
7665 let len = __tmp.len();
7666 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7667 } else {
7668 __tmp.len()
7669 }
7670 }
7671}
7672#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7673#[doc = ""]
7674#[doc = "ID: 276"]
7675#[derive(Debug, Clone, PartialEq)]
7676#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7677#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7678#[cfg_attr(feature = "ts", derive(TS))]
7679#[cfg_attr(feature = "ts", ts(export))]
7680pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7681 #[doc = "Latitude of tracked object"]
7682 pub lat: i32,
7683 #[doc = "Longitude of tracked object"]
7684 pub lon: i32,
7685 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7686 pub alt: f32,
7687 #[doc = "Horizontal accuracy. NAN if unknown"]
7688 pub h_acc: f32,
7689 #[doc = "Vertical accuracy. NAN if unknown"]
7690 pub v_acc: f32,
7691 #[doc = "North velocity of tracked object. NAN if unknown"]
7692 pub vel_n: f32,
7693 #[doc = "East velocity of tracked object. NAN if unknown"]
7694 pub vel_e: f32,
7695 #[doc = "Down velocity of tracked object. NAN if unknown"]
7696 pub vel_d: f32,
7697 #[doc = "Velocity accuracy. NAN if unknown"]
7698 pub vel_acc: f32,
7699 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7700 pub dist: f32,
7701 #[doc = "Heading in radians, in NED. NAN if unknown"]
7702 pub hdg: f32,
7703 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7704 pub hdg_acc: f32,
7705 #[doc = "Current tracking status"]
7706 pub tracking_status: CameraTrackingStatusFlags,
7707 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7708 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7709 pub camera_device_id: u8,
7710}
7711impl CAMERA_TRACKING_GEO_STATUS_DATA {
7712 pub const ENCODED_LEN: usize = 50usize;
7713 pub const DEFAULT: Self = Self {
7714 lat: 0_i32,
7715 lon: 0_i32,
7716 alt: 0.0_f32,
7717 h_acc: 0.0_f32,
7718 v_acc: 0.0_f32,
7719 vel_n: 0.0_f32,
7720 vel_e: 0.0_f32,
7721 vel_d: 0.0_f32,
7722 vel_acc: 0.0_f32,
7723 dist: 0.0_f32,
7724 hdg: 0.0_f32,
7725 hdg_acc: 0.0_f32,
7726 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7727 camera_device_id: 0_u8,
7728 };
7729 #[cfg(feature = "arbitrary")]
7730 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7731 use arbitrary::{Arbitrary, Unstructured};
7732 let mut buf = [0u8; 1024];
7733 rng.fill_bytes(&mut buf);
7734 let mut unstructured = Unstructured::new(&buf);
7735 Self::arbitrary(&mut unstructured).unwrap_or_default()
7736 }
7737}
7738impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7739 fn default() -> Self {
7740 Self::DEFAULT.clone()
7741 }
7742}
7743impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7744 type Message = MavMessage;
7745 const ID: u32 = 276u32;
7746 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7747 const EXTRA_CRC: u8 = 18u8;
7748 const ENCODED_LEN: usize = 50usize;
7749 fn deser(
7750 _version: MavlinkVersion,
7751 __input: &[u8],
7752 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7753 let avail_len = __input.len();
7754 let mut payload_buf = [0; Self::ENCODED_LEN];
7755 let mut buf = if avail_len < Self::ENCODED_LEN {
7756 payload_buf[0..avail_len].copy_from_slice(__input);
7757 Bytes::new(&payload_buf)
7758 } else {
7759 Bytes::new(__input)
7760 };
7761 let mut __struct = Self::default();
7762 __struct.lat = buf.get_i32_le();
7763 __struct.lon = buf.get_i32_le();
7764 __struct.alt = buf.get_f32_le();
7765 __struct.h_acc = buf.get_f32_le();
7766 __struct.v_acc = buf.get_f32_le();
7767 __struct.vel_n = buf.get_f32_le();
7768 __struct.vel_e = buf.get_f32_le();
7769 __struct.vel_d = buf.get_f32_le();
7770 __struct.vel_acc = buf.get_f32_le();
7771 __struct.dist = buf.get_f32_le();
7772 __struct.hdg = buf.get_f32_le();
7773 __struct.hdg_acc = buf.get_f32_le();
7774 let tmp = buf.get_u8();
7775 __struct.tracking_status =
7776 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7777 enum_type: "CameraTrackingStatusFlags",
7778 value: tmp as u32,
7779 })?;
7780 __struct.camera_device_id = buf.get_u8();
7781 Ok(__struct)
7782 }
7783 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7784 let mut __tmp = BytesMut::new(bytes);
7785 #[allow(clippy::absurd_extreme_comparisons)]
7786 #[allow(unused_comparisons)]
7787 if __tmp.remaining() < Self::ENCODED_LEN {
7788 panic!(
7789 "buffer is too small (need {} bytes, but got {})",
7790 Self::ENCODED_LEN,
7791 __tmp.remaining(),
7792 )
7793 }
7794 __tmp.put_i32_le(self.lat);
7795 __tmp.put_i32_le(self.lon);
7796 __tmp.put_f32_le(self.alt);
7797 __tmp.put_f32_le(self.h_acc);
7798 __tmp.put_f32_le(self.v_acc);
7799 __tmp.put_f32_le(self.vel_n);
7800 __tmp.put_f32_le(self.vel_e);
7801 __tmp.put_f32_le(self.vel_d);
7802 __tmp.put_f32_le(self.vel_acc);
7803 __tmp.put_f32_le(self.dist);
7804 __tmp.put_f32_le(self.hdg);
7805 __tmp.put_f32_le(self.hdg_acc);
7806 __tmp.put_u8(self.tracking_status as u8);
7807 if matches!(version, MavlinkVersion::V2) {
7808 __tmp.put_u8(self.camera_device_id);
7809 let len = __tmp.len();
7810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7811 } else {
7812 __tmp.len()
7813 }
7814 }
7815}
7816#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7817#[doc = ""]
7818#[doc = "ID: 275"]
7819#[derive(Debug, Clone, PartialEq)]
7820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7822#[cfg_attr(feature = "ts", derive(TS))]
7823#[cfg_attr(feature = "ts", ts(export))]
7824pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7825 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7826 pub point_x: f32,
7827 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7828 pub point_y: f32,
7829 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7830 pub radius: f32,
7831 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7832 pub rec_top_x: f32,
7833 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7834 pub rec_top_y: f32,
7835 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7836 pub rec_bottom_x: f32,
7837 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7838 pub rec_bottom_y: f32,
7839 #[doc = "Current tracking status"]
7840 pub tracking_status: CameraTrackingStatusFlags,
7841 #[doc = "Current tracking mode"]
7842 pub tracking_mode: CameraTrackingMode,
7843 #[doc = "Defines location of target data"]
7844 pub target_data: CameraTrackingTargetData,
7845 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7846 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7847 pub camera_device_id: u8,
7848}
7849impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7850 pub const ENCODED_LEN: usize = 32usize;
7851 pub const DEFAULT: Self = Self {
7852 point_x: 0.0_f32,
7853 point_y: 0.0_f32,
7854 radius: 0.0_f32,
7855 rec_top_x: 0.0_f32,
7856 rec_top_y: 0.0_f32,
7857 rec_bottom_x: 0.0_f32,
7858 rec_bottom_y: 0.0_f32,
7859 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7860 tracking_mode: CameraTrackingMode::DEFAULT,
7861 target_data: CameraTrackingTargetData::DEFAULT,
7862 camera_device_id: 0_u8,
7863 };
7864 #[cfg(feature = "arbitrary")]
7865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7866 use arbitrary::{Arbitrary, Unstructured};
7867 let mut buf = [0u8; 1024];
7868 rng.fill_bytes(&mut buf);
7869 let mut unstructured = Unstructured::new(&buf);
7870 Self::arbitrary(&mut unstructured).unwrap_or_default()
7871 }
7872}
7873impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7874 fn default() -> Self {
7875 Self::DEFAULT.clone()
7876 }
7877}
7878impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7879 type Message = MavMessage;
7880 const ID: u32 = 275u32;
7881 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7882 const EXTRA_CRC: u8 = 126u8;
7883 const ENCODED_LEN: usize = 32usize;
7884 fn deser(
7885 _version: MavlinkVersion,
7886 __input: &[u8],
7887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7888 let avail_len = __input.len();
7889 let mut payload_buf = [0; Self::ENCODED_LEN];
7890 let mut buf = if avail_len < Self::ENCODED_LEN {
7891 payload_buf[0..avail_len].copy_from_slice(__input);
7892 Bytes::new(&payload_buf)
7893 } else {
7894 Bytes::new(__input)
7895 };
7896 let mut __struct = Self::default();
7897 __struct.point_x = buf.get_f32_le();
7898 __struct.point_y = buf.get_f32_le();
7899 __struct.radius = buf.get_f32_le();
7900 __struct.rec_top_x = buf.get_f32_le();
7901 __struct.rec_top_y = buf.get_f32_le();
7902 __struct.rec_bottom_x = buf.get_f32_le();
7903 __struct.rec_bottom_y = buf.get_f32_le();
7904 let tmp = buf.get_u8();
7905 __struct.tracking_status =
7906 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7907 enum_type: "CameraTrackingStatusFlags",
7908 value: tmp as u32,
7909 })?;
7910 let tmp = buf.get_u8();
7911 __struct.tracking_mode =
7912 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7913 enum_type: "CameraTrackingMode",
7914 value: tmp as u32,
7915 })?;
7916 let tmp = buf.get_u8();
7917 __struct.target_data =
7918 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7919 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7920 flag_type: "CameraTrackingTargetData",
7921 value: tmp as u32,
7922 })?;
7923 __struct.camera_device_id = buf.get_u8();
7924 Ok(__struct)
7925 }
7926 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7927 let mut __tmp = BytesMut::new(bytes);
7928 #[allow(clippy::absurd_extreme_comparisons)]
7929 #[allow(unused_comparisons)]
7930 if __tmp.remaining() < Self::ENCODED_LEN {
7931 panic!(
7932 "buffer is too small (need {} bytes, but got {})",
7933 Self::ENCODED_LEN,
7934 __tmp.remaining(),
7935 )
7936 }
7937 __tmp.put_f32_le(self.point_x);
7938 __tmp.put_f32_le(self.point_y);
7939 __tmp.put_f32_le(self.radius);
7940 __tmp.put_f32_le(self.rec_top_x);
7941 __tmp.put_f32_le(self.rec_top_y);
7942 __tmp.put_f32_le(self.rec_bottom_x);
7943 __tmp.put_f32_le(self.rec_bottom_y);
7944 __tmp.put_u8(self.tracking_status as u8);
7945 __tmp.put_u8(self.tracking_mode as u8);
7946 __tmp.put_u8(self.target_data.bits());
7947 if matches!(version, MavlinkVersion::V2) {
7948 __tmp.put_u8(self.camera_device_id);
7949 let len = __tmp.len();
7950 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7951 } else {
7952 __tmp.len()
7953 }
7954 }
7955}
7956#[doc = "Camera-IMU triggering and synchronisation message."]
7957#[doc = ""]
7958#[doc = "ID: 112"]
7959#[derive(Debug, Clone, PartialEq)]
7960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7962#[cfg_attr(feature = "ts", derive(TS))]
7963#[cfg_attr(feature = "ts", ts(export))]
7964pub struct CAMERA_TRIGGER_DATA {
7965 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7966 pub time_usec: u64,
7967 #[doc = "Image frame sequence"]
7968 pub seq: u32,
7969}
7970impl CAMERA_TRIGGER_DATA {
7971 pub const ENCODED_LEN: usize = 12usize;
7972 pub const DEFAULT: Self = Self {
7973 time_usec: 0_u64,
7974 seq: 0_u32,
7975 };
7976 #[cfg(feature = "arbitrary")]
7977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7978 use arbitrary::{Arbitrary, Unstructured};
7979 let mut buf = [0u8; 1024];
7980 rng.fill_bytes(&mut buf);
7981 let mut unstructured = Unstructured::new(&buf);
7982 Self::arbitrary(&mut unstructured).unwrap_or_default()
7983 }
7984}
7985impl Default for CAMERA_TRIGGER_DATA {
7986 fn default() -> Self {
7987 Self::DEFAULT.clone()
7988 }
7989}
7990impl MessageData for CAMERA_TRIGGER_DATA {
7991 type Message = MavMessage;
7992 const ID: u32 = 112u32;
7993 const NAME: &'static str = "CAMERA_TRIGGER";
7994 const EXTRA_CRC: u8 = 174u8;
7995 const ENCODED_LEN: usize = 12usize;
7996 fn deser(
7997 _version: MavlinkVersion,
7998 __input: &[u8],
7999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8000 let avail_len = __input.len();
8001 let mut payload_buf = [0; Self::ENCODED_LEN];
8002 let mut buf = if avail_len < Self::ENCODED_LEN {
8003 payload_buf[0..avail_len].copy_from_slice(__input);
8004 Bytes::new(&payload_buf)
8005 } else {
8006 Bytes::new(__input)
8007 };
8008 let mut __struct = Self::default();
8009 __struct.time_usec = buf.get_u64_le();
8010 __struct.seq = buf.get_u32_le();
8011 Ok(__struct)
8012 }
8013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8014 let mut __tmp = BytesMut::new(bytes);
8015 #[allow(clippy::absurd_extreme_comparisons)]
8016 #[allow(unused_comparisons)]
8017 if __tmp.remaining() < Self::ENCODED_LEN {
8018 panic!(
8019 "buffer is too small (need {} bytes, but got {})",
8020 Self::ENCODED_LEN,
8021 __tmp.remaining(),
8022 )
8023 }
8024 __tmp.put_u64_le(self.time_usec);
8025 __tmp.put_u32_le(self.seq);
8026 if matches!(version, MavlinkVersion::V2) {
8027 let len = __tmp.len();
8028 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8029 } else {
8030 __tmp.len()
8031 }
8032 }
8033}
8034#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8035#[doc = ""]
8036#[doc = "ID: 387"]
8037#[derive(Debug, Clone, PartialEq)]
8038#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8040#[cfg_attr(feature = "ts", derive(TS))]
8041#[cfg_attr(feature = "ts", ts(export))]
8042pub struct CANFD_FRAME_DATA {
8043 #[doc = "Frame ID"]
8044 pub id: u32,
8045 #[doc = "System ID."]
8046 pub target_system: u8,
8047 #[doc = "Component ID."]
8048 pub target_component: u8,
8049 #[doc = "bus number"]
8050 pub bus: u8,
8051 #[doc = "Frame length"]
8052 pub len: u8,
8053 #[doc = "Frame data"]
8054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8055 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8056 pub data: [u8; 64],
8057}
8058impl CANFD_FRAME_DATA {
8059 pub const ENCODED_LEN: usize = 72usize;
8060 pub const DEFAULT: Self = Self {
8061 id: 0_u32,
8062 target_system: 0_u8,
8063 target_component: 0_u8,
8064 bus: 0_u8,
8065 len: 0_u8,
8066 data: [0_u8; 64usize],
8067 };
8068 #[cfg(feature = "arbitrary")]
8069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8070 use arbitrary::{Arbitrary, Unstructured};
8071 let mut buf = [0u8; 1024];
8072 rng.fill_bytes(&mut buf);
8073 let mut unstructured = Unstructured::new(&buf);
8074 Self::arbitrary(&mut unstructured).unwrap_or_default()
8075 }
8076}
8077impl Default for CANFD_FRAME_DATA {
8078 fn default() -> Self {
8079 Self::DEFAULT.clone()
8080 }
8081}
8082impl MessageData for CANFD_FRAME_DATA {
8083 type Message = MavMessage;
8084 const ID: u32 = 387u32;
8085 const NAME: &'static str = "CANFD_FRAME";
8086 const EXTRA_CRC: u8 = 4u8;
8087 const ENCODED_LEN: usize = 72usize;
8088 fn deser(
8089 _version: MavlinkVersion,
8090 __input: &[u8],
8091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8092 let avail_len = __input.len();
8093 let mut payload_buf = [0; Self::ENCODED_LEN];
8094 let mut buf = if avail_len < Self::ENCODED_LEN {
8095 payload_buf[0..avail_len].copy_from_slice(__input);
8096 Bytes::new(&payload_buf)
8097 } else {
8098 Bytes::new(__input)
8099 };
8100 let mut __struct = Self::default();
8101 __struct.id = buf.get_u32_le();
8102 __struct.target_system = buf.get_u8();
8103 __struct.target_component = buf.get_u8();
8104 __struct.bus = buf.get_u8();
8105 __struct.len = buf.get_u8();
8106 for v in &mut __struct.data {
8107 let val = buf.get_u8();
8108 *v = val;
8109 }
8110 Ok(__struct)
8111 }
8112 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8113 let mut __tmp = BytesMut::new(bytes);
8114 #[allow(clippy::absurd_extreme_comparisons)]
8115 #[allow(unused_comparisons)]
8116 if __tmp.remaining() < Self::ENCODED_LEN {
8117 panic!(
8118 "buffer is too small (need {} bytes, but got {})",
8119 Self::ENCODED_LEN,
8120 __tmp.remaining(),
8121 )
8122 }
8123 __tmp.put_u32_le(self.id);
8124 __tmp.put_u8(self.target_system);
8125 __tmp.put_u8(self.target_component);
8126 __tmp.put_u8(self.bus);
8127 __tmp.put_u8(self.len);
8128 for val in &self.data {
8129 __tmp.put_u8(*val);
8130 }
8131 if matches!(version, MavlinkVersion::V2) {
8132 let len = __tmp.len();
8133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8134 } else {
8135 __tmp.len()
8136 }
8137 }
8138}
8139#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8140#[doc = ""]
8141#[doc = "ID: 388"]
8142#[derive(Debug, Clone, PartialEq)]
8143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8145#[cfg_attr(feature = "ts", derive(TS))]
8146#[cfg_attr(feature = "ts", ts(export))]
8147pub struct CAN_FILTER_MODIFY_DATA {
8148 #[doc = "filter IDs, length num_ids"]
8149 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8150 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8151 pub ids: [u16; 16],
8152 #[doc = "System ID."]
8153 pub target_system: u8,
8154 #[doc = "Component ID."]
8155 pub target_component: u8,
8156 #[doc = "bus number"]
8157 pub bus: u8,
8158 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8159 pub operation: CanFilterOp,
8160 #[doc = "number of IDs in filter list"]
8161 pub num_ids: u8,
8162}
8163impl CAN_FILTER_MODIFY_DATA {
8164 pub const ENCODED_LEN: usize = 37usize;
8165 pub const DEFAULT: Self = Self {
8166 ids: [0_u16; 16usize],
8167 target_system: 0_u8,
8168 target_component: 0_u8,
8169 bus: 0_u8,
8170 operation: CanFilterOp::DEFAULT,
8171 num_ids: 0_u8,
8172 };
8173 #[cfg(feature = "arbitrary")]
8174 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8175 use arbitrary::{Arbitrary, Unstructured};
8176 let mut buf = [0u8; 1024];
8177 rng.fill_bytes(&mut buf);
8178 let mut unstructured = Unstructured::new(&buf);
8179 Self::arbitrary(&mut unstructured).unwrap_or_default()
8180 }
8181}
8182impl Default for CAN_FILTER_MODIFY_DATA {
8183 fn default() -> Self {
8184 Self::DEFAULT.clone()
8185 }
8186}
8187impl MessageData for CAN_FILTER_MODIFY_DATA {
8188 type Message = MavMessage;
8189 const ID: u32 = 388u32;
8190 const NAME: &'static str = "CAN_FILTER_MODIFY";
8191 const EXTRA_CRC: u8 = 8u8;
8192 const ENCODED_LEN: usize = 37usize;
8193 fn deser(
8194 _version: MavlinkVersion,
8195 __input: &[u8],
8196 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8197 let avail_len = __input.len();
8198 let mut payload_buf = [0; Self::ENCODED_LEN];
8199 let mut buf = if avail_len < Self::ENCODED_LEN {
8200 payload_buf[0..avail_len].copy_from_slice(__input);
8201 Bytes::new(&payload_buf)
8202 } else {
8203 Bytes::new(__input)
8204 };
8205 let mut __struct = Self::default();
8206 for v in &mut __struct.ids {
8207 let val = buf.get_u16_le();
8208 *v = val;
8209 }
8210 __struct.target_system = buf.get_u8();
8211 __struct.target_component = buf.get_u8();
8212 __struct.bus = buf.get_u8();
8213 let tmp = buf.get_u8();
8214 __struct.operation =
8215 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8216 enum_type: "CanFilterOp",
8217 value: tmp as u32,
8218 })?;
8219 __struct.num_ids = buf.get_u8();
8220 Ok(__struct)
8221 }
8222 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8223 let mut __tmp = BytesMut::new(bytes);
8224 #[allow(clippy::absurd_extreme_comparisons)]
8225 #[allow(unused_comparisons)]
8226 if __tmp.remaining() < Self::ENCODED_LEN {
8227 panic!(
8228 "buffer is too small (need {} bytes, but got {})",
8229 Self::ENCODED_LEN,
8230 __tmp.remaining(),
8231 )
8232 }
8233 for val in &self.ids {
8234 __tmp.put_u16_le(*val);
8235 }
8236 __tmp.put_u8(self.target_system);
8237 __tmp.put_u8(self.target_component);
8238 __tmp.put_u8(self.bus);
8239 __tmp.put_u8(self.operation as u8);
8240 __tmp.put_u8(self.num_ids);
8241 if matches!(version, MavlinkVersion::V2) {
8242 let len = __tmp.len();
8243 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8244 } else {
8245 __tmp.len()
8246 }
8247 }
8248}
8249#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8250#[doc = ""]
8251#[doc = "ID: 386"]
8252#[derive(Debug, Clone, PartialEq)]
8253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8255#[cfg_attr(feature = "ts", derive(TS))]
8256#[cfg_attr(feature = "ts", ts(export))]
8257pub struct CAN_FRAME_DATA {
8258 #[doc = "Frame ID"]
8259 pub id: u32,
8260 #[doc = "System ID."]
8261 pub target_system: u8,
8262 #[doc = "Component ID."]
8263 pub target_component: u8,
8264 #[doc = "Bus number"]
8265 pub bus: u8,
8266 #[doc = "Frame length"]
8267 pub len: u8,
8268 #[doc = "Frame data"]
8269 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8270 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8271 pub data: [u8; 8],
8272}
8273impl CAN_FRAME_DATA {
8274 pub const ENCODED_LEN: usize = 16usize;
8275 pub const DEFAULT: Self = Self {
8276 id: 0_u32,
8277 target_system: 0_u8,
8278 target_component: 0_u8,
8279 bus: 0_u8,
8280 len: 0_u8,
8281 data: [0_u8; 8usize],
8282 };
8283 #[cfg(feature = "arbitrary")]
8284 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8285 use arbitrary::{Arbitrary, Unstructured};
8286 let mut buf = [0u8; 1024];
8287 rng.fill_bytes(&mut buf);
8288 let mut unstructured = Unstructured::new(&buf);
8289 Self::arbitrary(&mut unstructured).unwrap_or_default()
8290 }
8291}
8292impl Default for CAN_FRAME_DATA {
8293 fn default() -> Self {
8294 Self::DEFAULT.clone()
8295 }
8296}
8297impl MessageData for CAN_FRAME_DATA {
8298 type Message = MavMessage;
8299 const ID: u32 = 386u32;
8300 const NAME: &'static str = "CAN_FRAME";
8301 const EXTRA_CRC: u8 = 132u8;
8302 const ENCODED_LEN: usize = 16usize;
8303 fn deser(
8304 _version: MavlinkVersion,
8305 __input: &[u8],
8306 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8307 let avail_len = __input.len();
8308 let mut payload_buf = [0; Self::ENCODED_LEN];
8309 let mut buf = if avail_len < Self::ENCODED_LEN {
8310 payload_buf[0..avail_len].copy_from_slice(__input);
8311 Bytes::new(&payload_buf)
8312 } else {
8313 Bytes::new(__input)
8314 };
8315 let mut __struct = Self::default();
8316 __struct.id = buf.get_u32_le();
8317 __struct.target_system = buf.get_u8();
8318 __struct.target_component = buf.get_u8();
8319 __struct.bus = buf.get_u8();
8320 __struct.len = buf.get_u8();
8321 for v in &mut __struct.data {
8322 let val = buf.get_u8();
8323 *v = val;
8324 }
8325 Ok(__struct)
8326 }
8327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8328 let mut __tmp = BytesMut::new(bytes);
8329 #[allow(clippy::absurd_extreme_comparisons)]
8330 #[allow(unused_comparisons)]
8331 if __tmp.remaining() < Self::ENCODED_LEN {
8332 panic!(
8333 "buffer is too small (need {} bytes, but got {})",
8334 Self::ENCODED_LEN,
8335 __tmp.remaining(),
8336 )
8337 }
8338 __tmp.put_u32_le(self.id);
8339 __tmp.put_u8(self.target_system);
8340 __tmp.put_u8(self.target_component);
8341 __tmp.put_u8(self.bus);
8342 __tmp.put_u8(self.len);
8343 for val in &self.data {
8344 __tmp.put_u8(*val);
8345 }
8346 if matches!(version, MavlinkVersion::V2) {
8347 let len = __tmp.len();
8348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8349 } else {
8350 __tmp.len()
8351 }
8352 }
8353}
8354#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8355#[doc = ""]
8356#[doc = "ID: 336"]
8357#[derive(Debug, Clone, PartialEq)]
8358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8360#[cfg_attr(feature = "ts", derive(TS))]
8361#[cfg_attr(feature = "ts", ts(export))]
8362pub struct CELLULAR_CONFIG_DATA {
8363 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8364 pub enable_lte: u8,
8365 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8366 pub enable_pin: u8,
8367 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8368 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8369 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8370 pub pin: [u8; 16],
8371 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8372 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8373 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8374 pub new_pin: [u8; 16],
8375 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8376 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8377 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8378 pub apn: [u8; 32],
8379 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8380 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8381 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8382 pub puk: [u8; 16],
8383 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8384 pub roaming: u8,
8385 #[doc = "Message acceptance response (sent back to GS)."]
8386 pub response: CellularConfigResponse,
8387}
8388impl CELLULAR_CONFIG_DATA {
8389 pub const ENCODED_LEN: usize = 84usize;
8390 pub const DEFAULT: Self = Self {
8391 enable_lte: 0_u8,
8392 enable_pin: 0_u8,
8393 pin: [0_u8; 16usize],
8394 new_pin: [0_u8; 16usize],
8395 apn: [0_u8; 32usize],
8396 puk: [0_u8; 16usize],
8397 roaming: 0_u8,
8398 response: CellularConfigResponse::DEFAULT,
8399 };
8400 #[cfg(feature = "arbitrary")]
8401 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8402 use arbitrary::{Arbitrary, Unstructured};
8403 let mut buf = [0u8; 1024];
8404 rng.fill_bytes(&mut buf);
8405 let mut unstructured = Unstructured::new(&buf);
8406 Self::arbitrary(&mut unstructured).unwrap_or_default()
8407 }
8408}
8409impl Default for CELLULAR_CONFIG_DATA {
8410 fn default() -> Self {
8411 Self::DEFAULT.clone()
8412 }
8413}
8414impl MessageData for CELLULAR_CONFIG_DATA {
8415 type Message = MavMessage;
8416 const ID: u32 = 336u32;
8417 const NAME: &'static str = "CELLULAR_CONFIG";
8418 const EXTRA_CRC: u8 = 245u8;
8419 const ENCODED_LEN: usize = 84usize;
8420 fn deser(
8421 _version: MavlinkVersion,
8422 __input: &[u8],
8423 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8424 let avail_len = __input.len();
8425 let mut payload_buf = [0; Self::ENCODED_LEN];
8426 let mut buf = if avail_len < Self::ENCODED_LEN {
8427 payload_buf[0..avail_len].copy_from_slice(__input);
8428 Bytes::new(&payload_buf)
8429 } else {
8430 Bytes::new(__input)
8431 };
8432 let mut __struct = Self::default();
8433 __struct.enable_lte = buf.get_u8();
8434 __struct.enable_pin = buf.get_u8();
8435 for v in &mut __struct.pin {
8436 let val = buf.get_u8();
8437 *v = val;
8438 }
8439 for v in &mut __struct.new_pin {
8440 let val = buf.get_u8();
8441 *v = val;
8442 }
8443 for v in &mut __struct.apn {
8444 let val = buf.get_u8();
8445 *v = val;
8446 }
8447 for v in &mut __struct.puk {
8448 let val = buf.get_u8();
8449 *v = val;
8450 }
8451 __struct.roaming = buf.get_u8();
8452 let tmp = buf.get_u8();
8453 __struct.response =
8454 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8455 enum_type: "CellularConfigResponse",
8456 value: tmp as u32,
8457 })?;
8458 Ok(__struct)
8459 }
8460 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8461 let mut __tmp = BytesMut::new(bytes);
8462 #[allow(clippy::absurd_extreme_comparisons)]
8463 #[allow(unused_comparisons)]
8464 if __tmp.remaining() < Self::ENCODED_LEN {
8465 panic!(
8466 "buffer is too small (need {} bytes, but got {})",
8467 Self::ENCODED_LEN,
8468 __tmp.remaining(),
8469 )
8470 }
8471 __tmp.put_u8(self.enable_lte);
8472 __tmp.put_u8(self.enable_pin);
8473 for val in &self.pin {
8474 __tmp.put_u8(*val);
8475 }
8476 for val in &self.new_pin {
8477 __tmp.put_u8(*val);
8478 }
8479 for val in &self.apn {
8480 __tmp.put_u8(*val);
8481 }
8482 for val in &self.puk {
8483 __tmp.put_u8(*val);
8484 }
8485 __tmp.put_u8(self.roaming);
8486 __tmp.put_u8(self.response as u8);
8487 if matches!(version, MavlinkVersion::V2) {
8488 let len = __tmp.len();
8489 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8490 } else {
8491 __tmp.len()
8492 }
8493 }
8494}
8495#[doc = "Report current used cellular network status."]
8496#[doc = ""]
8497#[doc = "ID: 334"]
8498#[derive(Debug, Clone, PartialEq)]
8499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8500#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8501#[cfg_attr(feature = "ts", derive(TS))]
8502#[cfg_attr(feature = "ts", ts(export))]
8503pub struct CELLULAR_STATUS_DATA {
8504 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8505 pub mcc: u16,
8506 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8507 pub mnc: u16,
8508 #[doc = "Location area code. If unknown, set to 0"]
8509 pub lac: u16,
8510 #[doc = "Cellular modem status"]
8511 pub status: CellularStatusFlag,
8512 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8513 pub failure_reason: CellularNetworkFailedReason,
8514 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8515 pub mavtype: CellularNetworkRadioType,
8516 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8517 pub quality: u8,
8518}
8519impl CELLULAR_STATUS_DATA {
8520 pub const ENCODED_LEN: usize = 10usize;
8521 pub const DEFAULT: Self = Self {
8522 mcc: 0_u16,
8523 mnc: 0_u16,
8524 lac: 0_u16,
8525 status: CellularStatusFlag::DEFAULT,
8526 failure_reason: CellularNetworkFailedReason::DEFAULT,
8527 mavtype: CellularNetworkRadioType::DEFAULT,
8528 quality: 0_u8,
8529 };
8530 #[cfg(feature = "arbitrary")]
8531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8532 use arbitrary::{Arbitrary, Unstructured};
8533 let mut buf = [0u8; 1024];
8534 rng.fill_bytes(&mut buf);
8535 let mut unstructured = Unstructured::new(&buf);
8536 Self::arbitrary(&mut unstructured).unwrap_or_default()
8537 }
8538}
8539impl Default for CELLULAR_STATUS_DATA {
8540 fn default() -> Self {
8541 Self::DEFAULT.clone()
8542 }
8543}
8544impl MessageData for CELLULAR_STATUS_DATA {
8545 type Message = MavMessage;
8546 const ID: u32 = 334u32;
8547 const NAME: &'static str = "CELLULAR_STATUS";
8548 const EXTRA_CRC: u8 = 72u8;
8549 const ENCODED_LEN: usize = 10usize;
8550 fn deser(
8551 _version: MavlinkVersion,
8552 __input: &[u8],
8553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8554 let avail_len = __input.len();
8555 let mut payload_buf = [0; Self::ENCODED_LEN];
8556 let mut buf = if avail_len < Self::ENCODED_LEN {
8557 payload_buf[0..avail_len].copy_from_slice(__input);
8558 Bytes::new(&payload_buf)
8559 } else {
8560 Bytes::new(__input)
8561 };
8562 let mut __struct = Self::default();
8563 __struct.mcc = buf.get_u16_le();
8564 __struct.mnc = buf.get_u16_le();
8565 __struct.lac = buf.get_u16_le();
8566 let tmp = buf.get_u8();
8567 __struct.status =
8568 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8569 enum_type: "CellularStatusFlag",
8570 value: tmp as u32,
8571 })?;
8572 let tmp = buf.get_u8();
8573 __struct.failure_reason =
8574 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8575 enum_type: "CellularNetworkFailedReason",
8576 value: tmp as u32,
8577 })?;
8578 let tmp = buf.get_u8();
8579 __struct.mavtype =
8580 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8581 enum_type: "CellularNetworkRadioType",
8582 value: tmp as u32,
8583 })?;
8584 __struct.quality = buf.get_u8();
8585 Ok(__struct)
8586 }
8587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8588 let mut __tmp = BytesMut::new(bytes);
8589 #[allow(clippy::absurd_extreme_comparisons)]
8590 #[allow(unused_comparisons)]
8591 if __tmp.remaining() < Self::ENCODED_LEN {
8592 panic!(
8593 "buffer is too small (need {} bytes, but got {})",
8594 Self::ENCODED_LEN,
8595 __tmp.remaining(),
8596 )
8597 }
8598 __tmp.put_u16_le(self.mcc);
8599 __tmp.put_u16_le(self.mnc);
8600 __tmp.put_u16_le(self.lac);
8601 __tmp.put_u8(self.status as u8);
8602 __tmp.put_u8(self.failure_reason as u8);
8603 __tmp.put_u8(self.mavtype as u8);
8604 __tmp.put_u8(self.quality);
8605 if matches!(version, MavlinkVersion::V2) {
8606 let len = __tmp.len();
8607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8608 } else {
8609 __tmp.len()
8610 }
8611 }
8612}
8613#[doc = "Request to control this MAV."]
8614#[doc = ""]
8615#[doc = "ID: 5"]
8616#[derive(Debug, Clone, PartialEq)]
8617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8619#[cfg_attr(feature = "ts", derive(TS))]
8620#[cfg_attr(feature = "ts", ts(export))]
8621pub struct CHANGE_OPERATOR_CONTROL_DATA {
8622 #[doc = "System the GCS requests control for"]
8623 pub target_system: u8,
8624 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8625 pub control_request: u8,
8626 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8627 pub version: u8,
8628 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8629 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8630 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8631 pub passkey: [u8; 25],
8632}
8633impl CHANGE_OPERATOR_CONTROL_DATA {
8634 pub const ENCODED_LEN: usize = 28usize;
8635 pub const DEFAULT: Self = Self {
8636 target_system: 0_u8,
8637 control_request: 0_u8,
8638 version: 0_u8,
8639 passkey: [0_u8; 25usize],
8640 };
8641 #[cfg(feature = "arbitrary")]
8642 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8643 use arbitrary::{Arbitrary, Unstructured};
8644 let mut buf = [0u8; 1024];
8645 rng.fill_bytes(&mut buf);
8646 let mut unstructured = Unstructured::new(&buf);
8647 Self::arbitrary(&mut unstructured).unwrap_or_default()
8648 }
8649}
8650impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8651 fn default() -> Self {
8652 Self::DEFAULT.clone()
8653 }
8654}
8655impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8656 type Message = MavMessage;
8657 const ID: u32 = 5u32;
8658 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8659 const EXTRA_CRC: u8 = 217u8;
8660 const ENCODED_LEN: usize = 28usize;
8661 fn deser(
8662 _version: MavlinkVersion,
8663 __input: &[u8],
8664 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8665 let avail_len = __input.len();
8666 let mut payload_buf = [0; Self::ENCODED_LEN];
8667 let mut buf = if avail_len < Self::ENCODED_LEN {
8668 payload_buf[0..avail_len].copy_from_slice(__input);
8669 Bytes::new(&payload_buf)
8670 } else {
8671 Bytes::new(__input)
8672 };
8673 let mut __struct = Self::default();
8674 __struct.target_system = buf.get_u8();
8675 __struct.control_request = buf.get_u8();
8676 __struct.version = buf.get_u8();
8677 for v in &mut __struct.passkey {
8678 let val = buf.get_u8();
8679 *v = val;
8680 }
8681 Ok(__struct)
8682 }
8683 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8684 let mut __tmp = BytesMut::new(bytes);
8685 #[allow(clippy::absurd_extreme_comparisons)]
8686 #[allow(unused_comparisons)]
8687 if __tmp.remaining() < Self::ENCODED_LEN {
8688 panic!(
8689 "buffer is too small (need {} bytes, but got {})",
8690 Self::ENCODED_LEN,
8691 __tmp.remaining(),
8692 )
8693 }
8694 __tmp.put_u8(self.target_system);
8695 __tmp.put_u8(self.control_request);
8696 __tmp.put_u8(self.version);
8697 for val in &self.passkey {
8698 __tmp.put_u8(*val);
8699 }
8700 if matches!(version, MavlinkVersion::V2) {
8701 let len = __tmp.len();
8702 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8703 } else {
8704 __tmp.len()
8705 }
8706 }
8707}
8708#[doc = "Accept / deny control of this MAV."]
8709#[doc = ""]
8710#[doc = "ID: 6"]
8711#[derive(Debug, Clone, PartialEq)]
8712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8713#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8714#[cfg_attr(feature = "ts", derive(TS))]
8715#[cfg_attr(feature = "ts", ts(export))]
8716pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8717 #[doc = "ID of the GCS this message"]
8718 pub gcs_system_id: u8,
8719 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8720 pub control_request: u8,
8721 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8722 pub ack: u8,
8723}
8724impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8725 pub const ENCODED_LEN: usize = 3usize;
8726 pub const DEFAULT: Self = Self {
8727 gcs_system_id: 0_u8,
8728 control_request: 0_u8,
8729 ack: 0_u8,
8730 };
8731 #[cfg(feature = "arbitrary")]
8732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8733 use arbitrary::{Arbitrary, Unstructured};
8734 let mut buf = [0u8; 1024];
8735 rng.fill_bytes(&mut buf);
8736 let mut unstructured = Unstructured::new(&buf);
8737 Self::arbitrary(&mut unstructured).unwrap_or_default()
8738 }
8739}
8740impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8741 fn default() -> Self {
8742 Self::DEFAULT.clone()
8743 }
8744}
8745impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8746 type Message = MavMessage;
8747 const ID: u32 = 6u32;
8748 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8749 const EXTRA_CRC: u8 = 104u8;
8750 const ENCODED_LEN: usize = 3usize;
8751 fn deser(
8752 _version: MavlinkVersion,
8753 __input: &[u8],
8754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8755 let avail_len = __input.len();
8756 let mut payload_buf = [0; Self::ENCODED_LEN];
8757 let mut buf = if avail_len < Self::ENCODED_LEN {
8758 payload_buf[0..avail_len].copy_from_slice(__input);
8759 Bytes::new(&payload_buf)
8760 } else {
8761 Bytes::new(__input)
8762 };
8763 let mut __struct = Self::default();
8764 __struct.gcs_system_id = buf.get_u8();
8765 __struct.control_request = buf.get_u8();
8766 __struct.ack = buf.get_u8();
8767 Ok(__struct)
8768 }
8769 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8770 let mut __tmp = BytesMut::new(bytes);
8771 #[allow(clippy::absurd_extreme_comparisons)]
8772 #[allow(unused_comparisons)]
8773 if __tmp.remaining() < Self::ENCODED_LEN {
8774 panic!(
8775 "buffer is too small (need {} bytes, but got {})",
8776 Self::ENCODED_LEN,
8777 __tmp.remaining(),
8778 )
8779 }
8780 __tmp.put_u8(self.gcs_system_id);
8781 __tmp.put_u8(self.control_request);
8782 __tmp.put_u8(self.ack);
8783 if matches!(version, MavlinkVersion::V2) {
8784 let len = __tmp.len();
8785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8786 } else {
8787 __tmp.len()
8788 }
8789 }
8790}
8791#[doc = "Information about a potential collision."]
8792#[doc = ""]
8793#[doc = "ID: 247"]
8794#[derive(Debug, Clone, PartialEq)]
8795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8796#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8797#[cfg_attr(feature = "ts", derive(TS))]
8798#[cfg_attr(feature = "ts", ts(export))]
8799pub struct COLLISION_DATA {
8800 #[doc = "Unique identifier, domain based on src field"]
8801 pub id: u32,
8802 #[doc = "Estimated time until collision occurs"]
8803 pub time_to_minimum_delta: f32,
8804 #[doc = "Closest vertical distance between vehicle and object"]
8805 pub altitude_minimum_delta: f32,
8806 #[doc = "Closest horizontal distance between vehicle and object"]
8807 pub horizontal_minimum_delta: f32,
8808 #[doc = "Collision data source"]
8809 pub src: MavCollisionSrc,
8810 #[doc = "Action that is being taken to avoid this collision"]
8811 pub action: MavCollisionAction,
8812 #[doc = "How concerned the aircraft is about this collision"]
8813 pub threat_level: MavCollisionThreatLevel,
8814}
8815impl COLLISION_DATA {
8816 pub const ENCODED_LEN: usize = 19usize;
8817 pub const DEFAULT: Self = Self {
8818 id: 0_u32,
8819 time_to_minimum_delta: 0.0_f32,
8820 altitude_minimum_delta: 0.0_f32,
8821 horizontal_minimum_delta: 0.0_f32,
8822 src: MavCollisionSrc::DEFAULT,
8823 action: MavCollisionAction::DEFAULT,
8824 threat_level: MavCollisionThreatLevel::DEFAULT,
8825 };
8826 #[cfg(feature = "arbitrary")]
8827 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8828 use arbitrary::{Arbitrary, Unstructured};
8829 let mut buf = [0u8; 1024];
8830 rng.fill_bytes(&mut buf);
8831 let mut unstructured = Unstructured::new(&buf);
8832 Self::arbitrary(&mut unstructured).unwrap_or_default()
8833 }
8834}
8835impl Default for COLLISION_DATA {
8836 fn default() -> Self {
8837 Self::DEFAULT.clone()
8838 }
8839}
8840impl MessageData for COLLISION_DATA {
8841 type Message = MavMessage;
8842 const ID: u32 = 247u32;
8843 const NAME: &'static str = "COLLISION";
8844 const EXTRA_CRC: u8 = 81u8;
8845 const ENCODED_LEN: usize = 19usize;
8846 fn deser(
8847 _version: MavlinkVersion,
8848 __input: &[u8],
8849 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8850 let avail_len = __input.len();
8851 let mut payload_buf = [0; Self::ENCODED_LEN];
8852 let mut buf = if avail_len < Self::ENCODED_LEN {
8853 payload_buf[0..avail_len].copy_from_slice(__input);
8854 Bytes::new(&payload_buf)
8855 } else {
8856 Bytes::new(__input)
8857 };
8858 let mut __struct = Self::default();
8859 __struct.id = buf.get_u32_le();
8860 __struct.time_to_minimum_delta = buf.get_f32_le();
8861 __struct.altitude_minimum_delta = buf.get_f32_le();
8862 __struct.horizontal_minimum_delta = buf.get_f32_le();
8863 let tmp = buf.get_u8();
8864 __struct.src =
8865 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8866 enum_type: "MavCollisionSrc",
8867 value: tmp as u32,
8868 })?;
8869 let tmp = buf.get_u8();
8870 __struct.action =
8871 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8872 enum_type: "MavCollisionAction",
8873 value: tmp as u32,
8874 })?;
8875 let tmp = buf.get_u8();
8876 __struct.threat_level =
8877 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8878 enum_type: "MavCollisionThreatLevel",
8879 value: tmp as u32,
8880 })?;
8881 Ok(__struct)
8882 }
8883 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8884 let mut __tmp = BytesMut::new(bytes);
8885 #[allow(clippy::absurd_extreme_comparisons)]
8886 #[allow(unused_comparisons)]
8887 if __tmp.remaining() < Self::ENCODED_LEN {
8888 panic!(
8889 "buffer is too small (need {} bytes, but got {})",
8890 Self::ENCODED_LEN,
8891 __tmp.remaining(),
8892 )
8893 }
8894 __tmp.put_u32_le(self.id);
8895 __tmp.put_f32_le(self.time_to_minimum_delta);
8896 __tmp.put_f32_le(self.altitude_minimum_delta);
8897 __tmp.put_f32_le(self.horizontal_minimum_delta);
8898 __tmp.put_u8(self.src as u8);
8899 __tmp.put_u8(self.action as u8);
8900 __tmp.put_u8(self.threat_level as u8);
8901 if matches!(version, MavlinkVersion::V2) {
8902 let len = __tmp.len();
8903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8904 } else {
8905 __tmp.len()
8906 }
8907 }
8908}
8909#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8910#[doc = ""]
8911#[doc = "ID: 77"]
8912#[derive(Debug, Clone, PartialEq)]
8913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8915#[cfg_attr(feature = "ts", derive(TS))]
8916#[cfg_attr(feature = "ts", ts(export))]
8917pub struct COMMAND_ACK_DATA {
8918 #[doc = "Command ID (of acknowledged command)."]
8919 pub command: MavCmd,
8920 #[doc = "Result of command."]
8921 pub result: MavResult,
8922 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8923 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8924 pub progress: u8,
8925 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8926 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8927 pub result_param2: i32,
8928 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8929 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8930 pub target_system: u8,
8931 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8932 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8933 pub target_component: u8,
8934}
8935impl COMMAND_ACK_DATA {
8936 pub const ENCODED_LEN: usize = 10usize;
8937 pub const DEFAULT: Self = Self {
8938 command: MavCmd::DEFAULT,
8939 result: MavResult::DEFAULT,
8940 progress: 0_u8,
8941 result_param2: 0_i32,
8942 target_system: 0_u8,
8943 target_component: 0_u8,
8944 };
8945 #[cfg(feature = "arbitrary")]
8946 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8947 use arbitrary::{Arbitrary, Unstructured};
8948 let mut buf = [0u8; 1024];
8949 rng.fill_bytes(&mut buf);
8950 let mut unstructured = Unstructured::new(&buf);
8951 Self::arbitrary(&mut unstructured).unwrap_or_default()
8952 }
8953}
8954impl Default for COMMAND_ACK_DATA {
8955 fn default() -> Self {
8956 Self::DEFAULT.clone()
8957 }
8958}
8959impl MessageData for COMMAND_ACK_DATA {
8960 type Message = MavMessage;
8961 const ID: u32 = 77u32;
8962 const NAME: &'static str = "COMMAND_ACK";
8963 const EXTRA_CRC: u8 = 143u8;
8964 const ENCODED_LEN: usize = 10usize;
8965 fn deser(
8966 _version: MavlinkVersion,
8967 __input: &[u8],
8968 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8969 let avail_len = __input.len();
8970 let mut payload_buf = [0; Self::ENCODED_LEN];
8971 let mut buf = if avail_len < Self::ENCODED_LEN {
8972 payload_buf[0..avail_len].copy_from_slice(__input);
8973 Bytes::new(&payload_buf)
8974 } else {
8975 Bytes::new(__input)
8976 };
8977 let mut __struct = Self::default();
8978 let tmp = buf.get_u16_le();
8979 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8980 ::mavlink_core::error::ParserError::InvalidEnum {
8981 enum_type: "MavCmd",
8982 value: tmp as u32,
8983 },
8984 )?;
8985 let tmp = buf.get_u8();
8986 __struct.result =
8987 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8988 enum_type: "MavResult",
8989 value: tmp as u32,
8990 })?;
8991 __struct.progress = buf.get_u8();
8992 __struct.result_param2 = buf.get_i32_le();
8993 __struct.target_system = buf.get_u8();
8994 __struct.target_component = buf.get_u8();
8995 Ok(__struct)
8996 }
8997 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8998 let mut __tmp = BytesMut::new(bytes);
8999 #[allow(clippy::absurd_extreme_comparisons)]
9000 #[allow(unused_comparisons)]
9001 if __tmp.remaining() < Self::ENCODED_LEN {
9002 panic!(
9003 "buffer is too small (need {} bytes, but got {})",
9004 Self::ENCODED_LEN,
9005 __tmp.remaining(),
9006 )
9007 }
9008 __tmp.put_u16_le(self.command as u16);
9009 __tmp.put_u8(self.result as u8);
9010 if matches!(version, MavlinkVersion::V2) {
9011 __tmp.put_u8(self.progress);
9012 __tmp.put_i32_le(self.result_param2);
9013 __tmp.put_u8(self.target_system);
9014 __tmp.put_u8(self.target_component);
9015 let len = __tmp.len();
9016 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9017 } else {
9018 __tmp.len()
9019 }
9020 }
9021}
9022#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9023#[doc = ""]
9024#[doc = "ID: 80"]
9025#[derive(Debug, Clone, PartialEq)]
9026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9028#[cfg_attr(feature = "ts", derive(TS))]
9029#[cfg_attr(feature = "ts", ts(export))]
9030pub struct COMMAND_CANCEL_DATA {
9031 #[doc = "Command ID (of command to cancel)."]
9032 pub command: MavCmd,
9033 #[doc = "System executing long running command. Should not be broadcast (0)."]
9034 pub target_system: u8,
9035 #[doc = "Component executing long running command."]
9036 pub target_component: u8,
9037}
9038impl COMMAND_CANCEL_DATA {
9039 pub const ENCODED_LEN: usize = 4usize;
9040 pub const DEFAULT: Self = Self {
9041 command: MavCmd::DEFAULT,
9042 target_system: 0_u8,
9043 target_component: 0_u8,
9044 };
9045 #[cfg(feature = "arbitrary")]
9046 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9047 use arbitrary::{Arbitrary, Unstructured};
9048 let mut buf = [0u8; 1024];
9049 rng.fill_bytes(&mut buf);
9050 let mut unstructured = Unstructured::new(&buf);
9051 Self::arbitrary(&mut unstructured).unwrap_or_default()
9052 }
9053}
9054impl Default for COMMAND_CANCEL_DATA {
9055 fn default() -> Self {
9056 Self::DEFAULT.clone()
9057 }
9058}
9059impl MessageData for COMMAND_CANCEL_DATA {
9060 type Message = MavMessage;
9061 const ID: u32 = 80u32;
9062 const NAME: &'static str = "COMMAND_CANCEL";
9063 const EXTRA_CRC: u8 = 14u8;
9064 const ENCODED_LEN: usize = 4usize;
9065 fn deser(
9066 _version: MavlinkVersion,
9067 __input: &[u8],
9068 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9069 let avail_len = __input.len();
9070 let mut payload_buf = [0; Self::ENCODED_LEN];
9071 let mut buf = if avail_len < Self::ENCODED_LEN {
9072 payload_buf[0..avail_len].copy_from_slice(__input);
9073 Bytes::new(&payload_buf)
9074 } else {
9075 Bytes::new(__input)
9076 };
9077 let mut __struct = Self::default();
9078 let tmp = buf.get_u16_le();
9079 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9080 ::mavlink_core::error::ParserError::InvalidEnum {
9081 enum_type: "MavCmd",
9082 value: tmp as u32,
9083 },
9084 )?;
9085 __struct.target_system = buf.get_u8();
9086 __struct.target_component = buf.get_u8();
9087 Ok(__struct)
9088 }
9089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9090 let mut __tmp = BytesMut::new(bytes);
9091 #[allow(clippy::absurd_extreme_comparisons)]
9092 #[allow(unused_comparisons)]
9093 if __tmp.remaining() < Self::ENCODED_LEN {
9094 panic!(
9095 "buffer is too small (need {} bytes, but got {})",
9096 Self::ENCODED_LEN,
9097 __tmp.remaining(),
9098 )
9099 }
9100 __tmp.put_u16_le(self.command as u16);
9101 __tmp.put_u8(self.target_system);
9102 __tmp.put_u8(self.target_component);
9103 if matches!(version, MavlinkVersion::V2) {
9104 let len = __tmp.len();
9105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9106 } else {
9107 __tmp.len()
9108 }
9109 }
9110}
9111#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9112#[doc = ""]
9113#[doc = "ID: 75"]
9114#[derive(Debug, Clone, PartialEq)]
9115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9117#[cfg_attr(feature = "ts", derive(TS))]
9118#[cfg_attr(feature = "ts", ts(export))]
9119pub struct COMMAND_INT_DATA {
9120 #[doc = "PARAM1, see MAV_CMD enum"]
9121 pub param1: f32,
9122 #[doc = "PARAM2, see MAV_CMD enum"]
9123 pub param2: f32,
9124 #[doc = "PARAM3, see MAV_CMD enum"]
9125 pub param3: f32,
9126 #[doc = "PARAM4, see MAV_CMD enum"]
9127 pub param4: f32,
9128 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9129 pub x: i32,
9130 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9131 pub y: i32,
9132 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9133 pub z: f32,
9134 #[doc = "The scheduled action for the mission item."]
9135 pub command: MavCmd,
9136 #[doc = "System ID"]
9137 pub target_system: u8,
9138 #[doc = "Component ID"]
9139 pub target_component: u8,
9140 #[doc = "The coordinate system of the COMMAND."]
9141 pub frame: MavFrame,
9142 #[doc = "Not used."]
9143 pub current: u8,
9144 #[doc = "Not used (set 0)."]
9145 pub autocontinue: u8,
9146}
9147impl COMMAND_INT_DATA {
9148 pub const ENCODED_LEN: usize = 35usize;
9149 pub const DEFAULT: Self = Self {
9150 param1: 0.0_f32,
9151 param2: 0.0_f32,
9152 param3: 0.0_f32,
9153 param4: 0.0_f32,
9154 x: 0_i32,
9155 y: 0_i32,
9156 z: 0.0_f32,
9157 command: MavCmd::DEFAULT,
9158 target_system: 0_u8,
9159 target_component: 0_u8,
9160 frame: MavFrame::DEFAULT,
9161 current: 0_u8,
9162 autocontinue: 0_u8,
9163 };
9164 #[cfg(feature = "arbitrary")]
9165 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9166 use arbitrary::{Arbitrary, Unstructured};
9167 let mut buf = [0u8; 1024];
9168 rng.fill_bytes(&mut buf);
9169 let mut unstructured = Unstructured::new(&buf);
9170 Self::arbitrary(&mut unstructured).unwrap_or_default()
9171 }
9172}
9173impl Default for COMMAND_INT_DATA {
9174 fn default() -> Self {
9175 Self::DEFAULT.clone()
9176 }
9177}
9178impl MessageData for COMMAND_INT_DATA {
9179 type Message = MavMessage;
9180 const ID: u32 = 75u32;
9181 const NAME: &'static str = "COMMAND_INT";
9182 const EXTRA_CRC: u8 = 158u8;
9183 const ENCODED_LEN: usize = 35usize;
9184 fn deser(
9185 _version: MavlinkVersion,
9186 __input: &[u8],
9187 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9188 let avail_len = __input.len();
9189 let mut payload_buf = [0; Self::ENCODED_LEN];
9190 let mut buf = if avail_len < Self::ENCODED_LEN {
9191 payload_buf[0..avail_len].copy_from_slice(__input);
9192 Bytes::new(&payload_buf)
9193 } else {
9194 Bytes::new(__input)
9195 };
9196 let mut __struct = Self::default();
9197 __struct.param1 = buf.get_f32_le();
9198 __struct.param2 = buf.get_f32_le();
9199 __struct.param3 = buf.get_f32_le();
9200 __struct.param4 = buf.get_f32_le();
9201 __struct.x = buf.get_i32_le();
9202 __struct.y = buf.get_i32_le();
9203 __struct.z = buf.get_f32_le();
9204 let tmp = buf.get_u16_le();
9205 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9206 ::mavlink_core::error::ParserError::InvalidEnum {
9207 enum_type: "MavCmd",
9208 value: tmp as u32,
9209 },
9210 )?;
9211 __struct.target_system = buf.get_u8();
9212 __struct.target_component = buf.get_u8();
9213 let tmp = buf.get_u8();
9214 __struct.frame =
9215 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9216 enum_type: "MavFrame",
9217 value: tmp as u32,
9218 })?;
9219 __struct.current = buf.get_u8();
9220 __struct.autocontinue = buf.get_u8();
9221 Ok(__struct)
9222 }
9223 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9224 let mut __tmp = BytesMut::new(bytes);
9225 #[allow(clippy::absurd_extreme_comparisons)]
9226 #[allow(unused_comparisons)]
9227 if __tmp.remaining() < Self::ENCODED_LEN {
9228 panic!(
9229 "buffer is too small (need {} bytes, but got {})",
9230 Self::ENCODED_LEN,
9231 __tmp.remaining(),
9232 )
9233 }
9234 __tmp.put_f32_le(self.param1);
9235 __tmp.put_f32_le(self.param2);
9236 __tmp.put_f32_le(self.param3);
9237 __tmp.put_f32_le(self.param4);
9238 __tmp.put_i32_le(self.x);
9239 __tmp.put_i32_le(self.y);
9240 __tmp.put_f32_le(self.z);
9241 __tmp.put_u16_le(self.command as u16);
9242 __tmp.put_u8(self.target_system);
9243 __tmp.put_u8(self.target_component);
9244 __tmp.put_u8(self.frame as u8);
9245 __tmp.put_u8(self.current);
9246 __tmp.put_u8(self.autocontinue);
9247 if matches!(version, MavlinkVersion::V2) {
9248 let len = __tmp.len();
9249 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9250 } else {
9251 __tmp.len()
9252 }
9253 }
9254}
9255#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9256#[doc = ""]
9257#[doc = "ID: 76"]
9258#[derive(Debug, Clone, PartialEq)]
9259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9261#[cfg_attr(feature = "ts", derive(TS))]
9262#[cfg_attr(feature = "ts", ts(export))]
9263pub struct COMMAND_LONG_DATA {
9264 #[doc = "Parameter 1 (for the specific command)."]
9265 pub param1: f32,
9266 #[doc = "Parameter 2 (for the specific command)."]
9267 pub param2: f32,
9268 #[doc = "Parameter 3 (for the specific command)."]
9269 pub param3: f32,
9270 #[doc = "Parameter 4 (for the specific command)."]
9271 pub param4: f32,
9272 #[doc = "Parameter 5 (for the specific command)."]
9273 pub param5: f32,
9274 #[doc = "Parameter 6 (for the specific command)."]
9275 pub param6: f32,
9276 #[doc = "Parameter 7 (for the specific command)."]
9277 pub param7: f32,
9278 #[doc = "Command ID (of command to send)."]
9279 pub command: MavCmd,
9280 #[doc = "System which should execute the command"]
9281 pub target_system: u8,
9282 #[doc = "Component which should execute the command, 0 for all components"]
9283 pub target_component: u8,
9284 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9285 pub confirmation: u8,
9286}
9287impl COMMAND_LONG_DATA {
9288 pub const ENCODED_LEN: usize = 33usize;
9289 pub const DEFAULT: Self = Self {
9290 param1: 0.0_f32,
9291 param2: 0.0_f32,
9292 param3: 0.0_f32,
9293 param4: 0.0_f32,
9294 param5: 0.0_f32,
9295 param6: 0.0_f32,
9296 param7: 0.0_f32,
9297 command: MavCmd::DEFAULT,
9298 target_system: 0_u8,
9299 target_component: 0_u8,
9300 confirmation: 0_u8,
9301 };
9302 #[cfg(feature = "arbitrary")]
9303 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9304 use arbitrary::{Arbitrary, Unstructured};
9305 let mut buf = [0u8; 1024];
9306 rng.fill_bytes(&mut buf);
9307 let mut unstructured = Unstructured::new(&buf);
9308 Self::arbitrary(&mut unstructured).unwrap_or_default()
9309 }
9310}
9311impl Default for COMMAND_LONG_DATA {
9312 fn default() -> Self {
9313 Self::DEFAULT.clone()
9314 }
9315}
9316impl MessageData for COMMAND_LONG_DATA {
9317 type Message = MavMessage;
9318 const ID: u32 = 76u32;
9319 const NAME: &'static str = "COMMAND_LONG";
9320 const EXTRA_CRC: u8 = 152u8;
9321 const ENCODED_LEN: usize = 33usize;
9322 fn deser(
9323 _version: MavlinkVersion,
9324 __input: &[u8],
9325 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9326 let avail_len = __input.len();
9327 let mut payload_buf = [0; Self::ENCODED_LEN];
9328 let mut buf = if avail_len < Self::ENCODED_LEN {
9329 payload_buf[0..avail_len].copy_from_slice(__input);
9330 Bytes::new(&payload_buf)
9331 } else {
9332 Bytes::new(__input)
9333 };
9334 let mut __struct = Self::default();
9335 __struct.param1 = buf.get_f32_le();
9336 __struct.param2 = buf.get_f32_le();
9337 __struct.param3 = buf.get_f32_le();
9338 __struct.param4 = buf.get_f32_le();
9339 __struct.param5 = buf.get_f32_le();
9340 __struct.param6 = buf.get_f32_le();
9341 __struct.param7 = buf.get_f32_le();
9342 let tmp = buf.get_u16_le();
9343 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9344 ::mavlink_core::error::ParserError::InvalidEnum {
9345 enum_type: "MavCmd",
9346 value: tmp as u32,
9347 },
9348 )?;
9349 __struct.target_system = buf.get_u8();
9350 __struct.target_component = buf.get_u8();
9351 __struct.confirmation = buf.get_u8();
9352 Ok(__struct)
9353 }
9354 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9355 let mut __tmp = BytesMut::new(bytes);
9356 #[allow(clippy::absurd_extreme_comparisons)]
9357 #[allow(unused_comparisons)]
9358 if __tmp.remaining() < Self::ENCODED_LEN {
9359 panic!(
9360 "buffer is too small (need {} bytes, but got {})",
9361 Self::ENCODED_LEN,
9362 __tmp.remaining(),
9363 )
9364 }
9365 __tmp.put_f32_le(self.param1);
9366 __tmp.put_f32_le(self.param2);
9367 __tmp.put_f32_le(self.param3);
9368 __tmp.put_f32_le(self.param4);
9369 __tmp.put_f32_le(self.param5);
9370 __tmp.put_f32_le(self.param6);
9371 __tmp.put_f32_le(self.param7);
9372 __tmp.put_u16_le(self.command as u16);
9373 __tmp.put_u8(self.target_system);
9374 __tmp.put_u8(self.target_component);
9375 __tmp.put_u8(self.confirmation);
9376 if matches!(version, MavlinkVersion::V2) {
9377 let len = __tmp.len();
9378 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9379 } else {
9380 __tmp.len()
9381 }
9382 }
9383}
9384#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9385#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9386#[doc = ""]
9387#[doc = "ID: 395"]
9388#[derive(Debug, Clone, PartialEq)]
9389#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9390#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9391#[cfg_attr(feature = "ts", derive(TS))]
9392#[cfg_attr(feature = "ts", ts(export))]
9393pub struct COMPONENT_INFORMATION_DATA {
9394 #[doc = "Timestamp (time since system boot)."]
9395 pub time_boot_ms: u32,
9396 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9397 pub general_metadata_file_crc: u32,
9398 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9399 pub peripherals_metadata_file_crc: u32,
9400 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9401 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9402 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9403 pub general_metadata_uri: [u8; 100],
9404 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9405 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9406 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9407 pub peripherals_metadata_uri: [u8; 100],
9408}
9409impl COMPONENT_INFORMATION_DATA {
9410 pub const ENCODED_LEN: usize = 212usize;
9411 pub const DEFAULT: Self = Self {
9412 time_boot_ms: 0_u32,
9413 general_metadata_file_crc: 0_u32,
9414 peripherals_metadata_file_crc: 0_u32,
9415 general_metadata_uri: [0_u8; 100usize],
9416 peripherals_metadata_uri: [0_u8; 100usize],
9417 };
9418 #[cfg(feature = "arbitrary")]
9419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9420 use arbitrary::{Arbitrary, Unstructured};
9421 let mut buf = [0u8; 1024];
9422 rng.fill_bytes(&mut buf);
9423 let mut unstructured = Unstructured::new(&buf);
9424 Self::arbitrary(&mut unstructured).unwrap_or_default()
9425 }
9426}
9427impl Default for COMPONENT_INFORMATION_DATA {
9428 fn default() -> Self {
9429 Self::DEFAULT.clone()
9430 }
9431}
9432impl MessageData for COMPONENT_INFORMATION_DATA {
9433 type Message = MavMessage;
9434 const ID: u32 = 395u32;
9435 const NAME: &'static str = "COMPONENT_INFORMATION";
9436 const EXTRA_CRC: u8 = 0u8;
9437 const ENCODED_LEN: usize = 212usize;
9438 fn deser(
9439 _version: MavlinkVersion,
9440 __input: &[u8],
9441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9442 let avail_len = __input.len();
9443 let mut payload_buf = [0; Self::ENCODED_LEN];
9444 let mut buf = if avail_len < Self::ENCODED_LEN {
9445 payload_buf[0..avail_len].copy_from_slice(__input);
9446 Bytes::new(&payload_buf)
9447 } else {
9448 Bytes::new(__input)
9449 };
9450 let mut __struct = Self::default();
9451 __struct.time_boot_ms = buf.get_u32_le();
9452 __struct.general_metadata_file_crc = buf.get_u32_le();
9453 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9454 for v in &mut __struct.general_metadata_uri {
9455 let val = buf.get_u8();
9456 *v = val;
9457 }
9458 for v in &mut __struct.peripherals_metadata_uri {
9459 let val = buf.get_u8();
9460 *v = val;
9461 }
9462 Ok(__struct)
9463 }
9464 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9465 let mut __tmp = BytesMut::new(bytes);
9466 #[allow(clippy::absurd_extreme_comparisons)]
9467 #[allow(unused_comparisons)]
9468 if __tmp.remaining() < Self::ENCODED_LEN {
9469 panic!(
9470 "buffer is too small (need {} bytes, but got {})",
9471 Self::ENCODED_LEN,
9472 __tmp.remaining(),
9473 )
9474 }
9475 __tmp.put_u32_le(self.time_boot_ms);
9476 __tmp.put_u32_le(self.general_metadata_file_crc);
9477 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9478 for val in &self.general_metadata_uri {
9479 __tmp.put_u8(*val);
9480 }
9481 for val in &self.peripherals_metadata_uri {
9482 __tmp.put_u8(*val);
9483 }
9484 if matches!(version, MavlinkVersion::V2) {
9485 let len = __tmp.len();
9486 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9487 } else {
9488 __tmp.len()
9489 }
9490 }
9491}
9492#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9493#[doc = ""]
9494#[doc = "ID: 396"]
9495#[derive(Debug, Clone, PartialEq)]
9496#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9497#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9498#[cfg_attr(feature = "ts", derive(TS))]
9499#[cfg_attr(feature = "ts", ts(export))]
9500pub struct COMPONENT_INFORMATION_BASIC_DATA {
9501 #[doc = "Component capability flags"]
9502 pub capabilities: MavProtocolCapability,
9503 #[doc = "Timestamp (time since system boot)."]
9504 pub time_boot_ms: u32,
9505 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9506 pub time_manufacture_s: u32,
9507 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9508 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9509 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9510 pub vendor_name: [u8; 32],
9511 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9512 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9513 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9514 pub model_name: [u8; 32],
9515 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9516 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9517 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9518 pub software_version: [u8; 24],
9519 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9520 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9521 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9522 pub hardware_version: [u8; 24],
9523 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9524 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9525 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9526 pub serial_number: [u8; 32],
9527}
9528impl COMPONENT_INFORMATION_BASIC_DATA {
9529 pub const ENCODED_LEN: usize = 160usize;
9530 pub const DEFAULT: Self = Self {
9531 capabilities: MavProtocolCapability::DEFAULT,
9532 time_boot_ms: 0_u32,
9533 time_manufacture_s: 0_u32,
9534 vendor_name: [0_u8; 32usize],
9535 model_name: [0_u8; 32usize],
9536 software_version: [0_u8; 24usize],
9537 hardware_version: [0_u8; 24usize],
9538 serial_number: [0_u8; 32usize],
9539 };
9540 #[cfg(feature = "arbitrary")]
9541 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9542 use arbitrary::{Arbitrary, Unstructured};
9543 let mut buf = [0u8; 1024];
9544 rng.fill_bytes(&mut buf);
9545 let mut unstructured = Unstructured::new(&buf);
9546 Self::arbitrary(&mut unstructured).unwrap_or_default()
9547 }
9548}
9549impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9550 fn default() -> Self {
9551 Self::DEFAULT.clone()
9552 }
9553}
9554impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9555 type Message = MavMessage;
9556 const ID: u32 = 396u32;
9557 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9558 const EXTRA_CRC: u8 = 50u8;
9559 const ENCODED_LEN: usize = 160usize;
9560 fn deser(
9561 _version: MavlinkVersion,
9562 __input: &[u8],
9563 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9564 let avail_len = __input.len();
9565 let mut payload_buf = [0; Self::ENCODED_LEN];
9566 let mut buf = if avail_len < Self::ENCODED_LEN {
9567 payload_buf[0..avail_len].copy_from_slice(__input);
9568 Bytes::new(&payload_buf)
9569 } else {
9570 Bytes::new(__input)
9571 };
9572 let mut __struct = Self::default();
9573 let tmp = buf.get_u64_le();
9574 __struct.capabilities = MavProtocolCapability::from_bits(
9575 tmp & MavProtocolCapability::all().bits(),
9576 )
9577 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9578 flag_type: "MavProtocolCapability",
9579 value: tmp as u32,
9580 })?;
9581 __struct.time_boot_ms = buf.get_u32_le();
9582 __struct.time_manufacture_s = buf.get_u32_le();
9583 for v in &mut __struct.vendor_name {
9584 let val = buf.get_u8();
9585 *v = val;
9586 }
9587 for v in &mut __struct.model_name {
9588 let val = buf.get_u8();
9589 *v = val;
9590 }
9591 for v in &mut __struct.software_version {
9592 let val = buf.get_u8();
9593 *v = val;
9594 }
9595 for v in &mut __struct.hardware_version {
9596 let val = buf.get_u8();
9597 *v = val;
9598 }
9599 for v in &mut __struct.serial_number {
9600 let val = buf.get_u8();
9601 *v = val;
9602 }
9603 Ok(__struct)
9604 }
9605 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9606 let mut __tmp = BytesMut::new(bytes);
9607 #[allow(clippy::absurd_extreme_comparisons)]
9608 #[allow(unused_comparisons)]
9609 if __tmp.remaining() < Self::ENCODED_LEN {
9610 panic!(
9611 "buffer is too small (need {} bytes, but got {})",
9612 Self::ENCODED_LEN,
9613 __tmp.remaining(),
9614 )
9615 }
9616 __tmp.put_u64_le(self.capabilities.bits());
9617 __tmp.put_u32_le(self.time_boot_ms);
9618 __tmp.put_u32_le(self.time_manufacture_s);
9619 for val in &self.vendor_name {
9620 __tmp.put_u8(*val);
9621 }
9622 for val in &self.model_name {
9623 __tmp.put_u8(*val);
9624 }
9625 for val in &self.software_version {
9626 __tmp.put_u8(*val);
9627 }
9628 for val in &self.hardware_version {
9629 __tmp.put_u8(*val);
9630 }
9631 for val in &self.serial_number {
9632 __tmp.put_u8(*val);
9633 }
9634 if matches!(version, MavlinkVersion::V2) {
9635 let len = __tmp.len();
9636 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9637 } else {
9638 __tmp.len()
9639 }
9640 }
9641}
9642#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9643#[doc = ""]
9644#[doc = "ID: 397"]
9645#[derive(Debug, Clone, PartialEq)]
9646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9648#[cfg_attr(feature = "ts", derive(TS))]
9649#[cfg_attr(feature = "ts", ts(export))]
9650pub struct COMPONENT_METADATA_DATA {
9651 #[doc = "Timestamp (time since system boot)."]
9652 pub time_boot_ms: u32,
9653 #[doc = "CRC32 of the general metadata file."]
9654 pub file_crc: u32,
9655 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9656 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9657 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9658 pub uri: [u8; 100],
9659}
9660impl COMPONENT_METADATA_DATA {
9661 pub const ENCODED_LEN: usize = 108usize;
9662 pub const DEFAULT: Self = Self {
9663 time_boot_ms: 0_u32,
9664 file_crc: 0_u32,
9665 uri: [0_u8; 100usize],
9666 };
9667 #[cfg(feature = "arbitrary")]
9668 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9669 use arbitrary::{Arbitrary, Unstructured};
9670 let mut buf = [0u8; 1024];
9671 rng.fill_bytes(&mut buf);
9672 let mut unstructured = Unstructured::new(&buf);
9673 Self::arbitrary(&mut unstructured).unwrap_or_default()
9674 }
9675}
9676impl Default for COMPONENT_METADATA_DATA {
9677 fn default() -> Self {
9678 Self::DEFAULT.clone()
9679 }
9680}
9681impl MessageData for COMPONENT_METADATA_DATA {
9682 type Message = MavMessage;
9683 const ID: u32 = 397u32;
9684 const NAME: &'static str = "COMPONENT_METADATA";
9685 const EXTRA_CRC: u8 = 182u8;
9686 const ENCODED_LEN: usize = 108usize;
9687 fn deser(
9688 _version: MavlinkVersion,
9689 __input: &[u8],
9690 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9691 let avail_len = __input.len();
9692 let mut payload_buf = [0; Self::ENCODED_LEN];
9693 let mut buf = if avail_len < Self::ENCODED_LEN {
9694 payload_buf[0..avail_len].copy_from_slice(__input);
9695 Bytes::new(&payload_buf)
9696 } else {
9697 Bytes::new(__input)
9698 };
9699 let mut __struct = Self::default();
9700 __struct.time_boot_ms = buf.get_u32_le();
9701 __struct.file_crc = buf.get_u32_le();
9702 for v in &mut __struct.uri {
9703 let val = buf.get_u8();
9704 *v = val;
9705 }
9706 Ok(__struct)
9707 }
9708 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9709 let mut __tmp = BytesMut::new(bytes);
9710 #[allow(clippy::absurd_extreme_comparisons)]
9711 #[allow(unused_comparisons)]
9712 if __tmp.remaining() < Self::ENCODED_LEN {
9713 panic!(
9714 "buffer is too small (need {} bytes, but got {})",
9715 Self::ENCODED_LEN,
9716 __tmp.remaining(),
9717 )
9718 }
9719 __tmp.put_u32_le(self.time_boot_ms);
9720 __tmp.put_u32_le(self.file_crc);
9721 for val in &self.uri {
9722 __tmp.put_u8(*val);
9723 }
9724 if matches!(version, MavlinkVersion::V2) {
9725 let len = __tmp.len();
9726 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9727 } else {
9728 __tmp.len()
9729 }
9730 }
9731}
9732#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9733#[doc = ""]
9734#[doc = "ID: 146"]
9735#[derive(Debug, Clone, PartialEq)]
9736#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9738#[cfg_attr(feature = "ts", derive(TS))]
9739#[cfg_attr(feature = "ts", ts(export))]
9740pub struct CONTROL_SYSTEM_STATE_DATA {
9741 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9742 pub time_usec: u64,
9743 #[doc = "X acceleration in body frame"]
9744 pub x_acc: f32,
9745 #[doc = "Y acceleration in body frame"]
9746 pub y_acc: f32,
9747 #[doc = "Z acceleration in body frame"]
9748 pub z_acc: f32,
9749 #[doc = "X velocity in body frame"]
9750 pub x_vel: f32,
9751 #[doc = "Y velocity in body frame"]
9752 pub y_vel: f32,
9753 #[doc = "Z velocity in body frame"]
9754 pub z_vel: f32,
9755 #[doc = "X position in local frame"]
9756 pub x_pos: f32,
9757 #[doc = "Y position in local frame"]
9758 pub y_pos: f32,
9759 #[doc = "Z position in local frame"]
9760 pub z_pos: f32,
9761 #[doc = "Airspeed, set to -1 if unknown"]
9762 pub airspeed: f32,
9763 #[doc = "Variance of body velocity estimate"]
9764 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9765 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9766 pub vel_variance: [f32; 3],
9767 #[doc = "Variance in local position"]
9768 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9769 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9770 pub pos_variance: [f32; 3],
9771 #[doc = "The attitude, represented as Quaternion"]
9772 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9773 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9774 pub q: [f32; 4],
9775 #[doc = "Angular rate in roll axis"]
9776 pub roll_rate: f32,
9777 #[doc = "Angular rate in pitch axis"]
9778 pub pitch_rate: f32,
9779 #[doc = "Angular rate in yaw axis"]
9780 pub yaw_rate: f32,
9781}
9782impl CONTROL_SYSTEM_STATE_DATA {
9783 pub const ENCODED_LEN: usize = 100usize;
9784 pub const DEFAULT: Self = Self {
9785 time_usec: 0_u64,
9786 x_acc: 0.0_f32,
9787 y_acc: 0.0_f32,
9788 z_acc: 0.0_f32,
9789 x_vel: 0.0_f32,
9790 y_vel: 0.0_f32,
9791 z_vel: 0.0_f32,
9792 x_pos: 0.0_f32,
9793 y_pos: 0.0_f32,
9794 z_pos: 0.0_f32,
9795 airspeed: 0.0_f32,
9796 vel_variance: [0.0_f32; 3usize],
9797 pos_variance: [0.0_f32; 3usize],
9798 q: [0.0_f32; 4usize],
9799 roll_rate: 0.0_f32,
9800 pitch_rate: 0.0_f32,
9801 yaw_rate: 0.0_f32,
9802 };
9803 #[cfg(feature = "arbitrary")]
9804 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9805 use arbitrary::{Arbitrary, Unstructured};
9806 let mut buf = [0u8; 1024];
9807 rng.fill_bytes(&mut buf);
9808 let mut unstructured = Unstructured::new(&buf);
9809 Self::arbitrary(&mut unstructured).unwrap_or_default()
9810 }
9811}
9812impl Default for CONTROL_SYSTEM_STATE_DATA {
9813 fn default() -> Self {
9814 Self::DEFAULT.clone()
9815 }
9816}
9817impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9818 type Message = MavMessage;
9819 const ID: u32 = 146u32;
9820 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9821 const EXTRA_CRC: u8 = 103u8;
9822 const ENCODED_LEN: usize = 100usize;
9823 fn deser(
9824 _version: MavlinkVersion,
9825 __input: &[u8],
9826 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9827 let avail_len = __input.len();
9828 let mut payload_buf = [0; Self::ENCODED_LEN];
9829 let mut buf = if avail_len < Self::ENCODED_LEN {
9830 payload_buf[0..avail_len].copy_from_slice(__input);
9831 Bytes::new(&payload_buf)
9832 } else {
9833 Bytes::new(__input)
9834 };
9835 let mut __struct = Self::default();
9836 __struct.time_usec = buf.get_u64_le();
9837 __struct.x_acc = buf.get_f32_le();
9838 __struct.y_acc = buf.get_f32_le();
9839 __struct.z_acc = buf.get_f32_le();
9840 __struct.x_vel = buf.get_f32_le();
9841 __struct.y_vel = buf.get_f32_le();
9842 __struct.z_vel = buf.get_f32_le();
9843 __struct.x_pos = buf.get_f32_le();
9844 __struct.y_pos = buf.get_f32_le();
9845 __struct.z_pos = buf.get_f32_le();
9846 __struct.airspeed = buf.get_f32_le();
9847 for v in &mut __struct.vel_variance {
9848 let val = buf.get_f32_le();
9849 *v = val;
9850 }
9851 for v in &mut __struct.pos_variance {
9852 let val = buf.get_f32_le();
9853 *v = val;
9854 }
9855 for v in &mut __struct.q {
9856 let val = buf.get_f32_le();
9857 *v = val;
9858 }
9859 __struct.roll_rate = buf.get_f32_le();
9860 __struct.pitch_rate = buf.get_f32_le();
9861 __struct.yaw_rate = buf.get_f32_le();
9862 Ok(__struct)
9863 }
9864 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9865 let mut __tmp = BytesMut::new(bytes);
9866 #[allow(clippy::absurd_extreme_comparisons)]
9867 #[allow(unused_comparisons)]
9868 if __tmp.remaining() < Self::ENCODED_LEN {
9869 panic!(
9870 "buffer is too small (need {} bytes, but got {})",
9871 Self::ENCODED_LEN,
9872 __tmp.remaining(),
9873 )
9874 }
9875 __tmp.put_u64_le(self.time_usec);
9876 __tmp.put_f32_le(self.x_acc);
9877 __tmp.put_f32_le(self.y_acc);
9878 __tmp.put_f32_le(self.z_acc);
9879 __tmp.put_f32_le(self.x_vel);
9880 __tmp.put_f32_le(self.y_vel);
9881 __tmp.put_f32_le(self.z_vel);
9882 __tmp.put_f32_le(self.x_pos);
9883 __tmp.put_f32_le(self.y_pos);
9884 __tmp.put_f32_le(self.z_pos);
9885 __tmp.put_f32_le(self.airspeed);
9886 for val in &self.vel_variance {
9887 __tmp.put_f32_le(*val);
9888 }
9889 for val in &self.pos_variance {
9890 __tmp.put_f32_le(*val);
9891 }
9892 for val in &self.q {
9893 __tmp.put_f32_le(*val);
9894 }
9895 __tmp.put_f32_le(self.roll_rate);
9896 __tmp.put_f32_le(self.pitch_rate);
9897 __tmp.put_f32_le(self.yaw_rate);
9898 if matches!(version, MavlinkVersion::V2) {
9899 let len = __tmp.len();
9900 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9901 } else {
9902 __tmp.len()
9903 }
9904 }
9905}
9906#[doc = "offset response to encapsulated data."]
9907#[doc = ""]
9908#[doc = "ID: 50005"]
9909#[derive(Debug, Clone, PartialEq)]
9910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9912#[cfg_attr(feature = "ts", derive(TS))]
9913#[cfg_attr(feature = "ts", ts(export))]
9914pub struct CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9915 #[doc = "FW Offset."]
9916 pub offset: u32,
9917 #[doc = "System ID."]
9918 pub target_system: u8,
9919 #[doc = "Component ID."]
9920 pub target_component: u8,
9921}
9922impl CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9923 pub const ENCODED_LEN: usize = 6usize;
9924 pub const DEFAULT: Self = Self {
9925 offset: 0_u32,
9926 target_system: 0_u8,
9927 target_component: 0_u8,
9928 };
9929 #[cfg(feature = "arbitrary")]
9930 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9931 use arbitrary::{Arbitrary, Unstructured};
9932 let mut buf = [0u8; 1024];
9933 rng.fill_bytes(&mut buf);
9934 let mut unstructured = Unstructured::new(&buf);
9935 Self::arbitrary(&mut unstructured).unwrap_or_default()
9936 }
9937}
9938impl Default for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9939 fn default() -> Self {
9940 Self::DEFAULT.clone()
9941 }
9942}
9943impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
9944 type Message = MavMessage;
9945 const ID: u32 = 50005u32;
9946 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_RESP";
9947 const EXTRA_CRC: u8 = 152u8;
9948 const ENCODED_LEN: usize = 6usize;
9949 fn deser(
9950 _version: MavlinkVersion,
9951 __input: &[u8],
9952 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9953 let avail_len = __input.len();
9954 let mut payload_buf = [0; Self::ENCODED_LEN];
9955 let mut buf = if avail_len < Self::ENCODED_LEN {
9956 payload_buf[0..avail_len].copy_from_slice(__input);
9957 Bytes::new(&payload_buf)
9958 } else {
9959 Bytes::new(__input)
9960 };
9961 let mut __struct = Self::default();
9962 __struct.offset = buf.get_u32_le();
9963 __struct.target_system = buf.get_u8();
9964 __struct.target_component = buf.get_u8();
9965 Ok(__struct)
9966 }
9967 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9968 let mut __tmp = BytesMut::new(bytes);
9969 #[allow(clippy::absurd_extreme_comparisons)]
9970 #[allow(unused_comparisons)]
9971 if __tmp.remaining() < Self::ENCODED_LEN {
9972 panic!(
9973 "buffer is too small (need {} bytes, but got {})",
9974 Self::ENCODED_LEN,
9975 __tmp.remaining(),
9976 )
9977 }
9978 __tmp.put_u32_le(self.offset);
9979 __tmp.put_u8(self.target_system);
9980 __tmp.put_u8(self.target_component);
9981 if matches!(version, MavlinkVersion::V2) {
9982 let len = __tmp.len();
9983 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9984 } else {
9985 __tmp.len()
9986 }
9987 }
9988}
9989#[doc = "Start firmware update with encapsulated data."]
9990#[doc = ""]
9991#[doc = "ID: 50004"]
9992#[derive(Debug, Clone, PartialEq)]
9993#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9995#[cfg_attr(feature = "ts", derive(TS))]
9996#[cfg_attr(feature = "ts", ts(export))]
9997pub struct CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
9998 #[doc = "FW Size."]
9999 pub size: u32,
10000 #[doc = "FW CRC."]
10001 pub crc: u32,
10002 #[doc = "System ID."]
10003 pub target_system: u8,
10004 #[doc = "Component ID."]
10005 pub target_component: u8,
10006}
10007impl CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10008 pub const ENCODED_LEN: usize = 10usize;
10009 pub const DEFAULT: Self = Self {
10010 size: 0_u32,
10011 crc: 0_u32,
10012 target_system: 0_u8,
10013 target_component: 0_u8,
10014 };
10015 #[cfg(feature = "arbitrary")]
10016 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10017 use arbitrary::{Arbitrary, Unstructured};
10018 let mut buf = [0u8; 1024];
10019 rng.fill_bytes(&mut buf);
10020 let mut unstructured = Unstructured::new(&buf);
10021 Self::arbitrary(&mut unstructured).unwrap_or_default()
10022 }
10023}
10024impl Default for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10025 fn default() -> Self {
10026 Self::DEFAULT.clone()
10027 }
10028}
10029impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
10030 type Message = MavMessage;
10031 const ID: u32 = 50004u32;
10032 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_START";
10033 const EXTRA_CRC: u8 = 240u8;
10034 const ENCODED_LEN: usize = 10usize;
10035 fn deser(
10036 _version: MavlinkVersion,
10037 __input: &[u8],
10038 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10039 let avail_len = __input.len();
10040 let mut payload_buf = [0; Self::ENCODED_LEN];
10041 let mut buf = if avail_len < Self::ENCODED_LEN {
10042 payload_buf[0..avail_len].copy_from_slice(__input);
10043 Bytes::new(&payload_buf)
10044 } else {
10045 Bytes::new(__input)
10046 };
10047 let mut __struct = Self::default();
10048 __struct.size = buf.get_u32_le();
10049 __struct.crc = buf.get_u32_le();
10050 __struct.target_system = buf.get_u8();
10051 __struct.target_component = buf.get_u8();
10052 Ok(__struct)
10053 }
10054 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10055 let mut __tmp = BytesMut::new(bytes);
10056 #[allow(clippy::absurd_extreme_comparisons)]
10057 #[allow(unused_comparisons)]
10058 if __tmp.remaining() < Self::ENCODED_LEN {
10059 panic!(
10060 "buffer is too small (need {} bytes, but got {})",
10061 Self::ENCODED_LEN,
10062 __tmp.remaining(),
10063 )
10064 }
10065 __tmp.put_u32_le(self.size);
10066 __tmp.put_u32_le(self.crc);
10067 __tmp.put_u8(self.target_system);
10068 __tmp.put_u8(self.target_component);
10069 if matches!(version, MavlinkVersion::V2) {
10070 let len = __tmp.len();
10071 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10072 } else {
10073 __tmp.len()
10074 }
10075 }
10076}
10077#[doc = "Raw RC Data."]
10078#[doc = ""]
10079#[doc = "ID: 50001"]
10080#[derive(Debug, Clone, PartialEq)]
10081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10083#[cfg_attr(feature = "ts", derive(TS))]
10084#[cfg_attr(feature = "ts", ts(export))]
10085pub struct CUBEPILOT_RAW_RC_DATA {
10086 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10087 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10088 pub rc_raw: [u8; 32],
10089}
10090impl CUBEPILOT_RAW_RC_DATA {
10091 pub const ENCODED_LEN: usize = 32usize;
10092 pub const DEFAULT: Self = Self {
10093 rc_raw: [0_u8; 32usize],
10094 };
10095 #[cfg(feature = "arbitrary")]
10096 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10097 use arbitrary::{Arbitrary, Unstructured};
10098 let mut buf = [0u8; 1024];
10099 rng.fill_bytes(&mut buf);
10100 let mut unstructured = Unstructured::new(&buf);
10101 Self::arbitrary(&mut unstructured).unwrap_or_default()
10102 }
10103}
10104impl Default for CUBEPILOT_RAW_RC_DATA {
10105 fn default() -> Self {
10106 Self::DEFAULT.clone()
10107 }
10108}
10109impl MessageData for CUBEPILOT_RAW_RC_DATA {
10110 type Message = MavMessage;
10111 const ID: u32 = 50001u32;
10112 const NAME: &'static str = "CUBEPILOT_RAW_RC";
10113 const EXTRA_CRC: u8 = 246u8;
10114 const ENCODED_LEN: usize = 32usize;
10115 fn deser(
10116 _version: MavlinkVersion,
10117 __input: &[u8],
10118 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10119 let avail_len = __input.len();
10120 let mut payload_buf = [0; Self::ENCODED_LEN];
10121 let mut buf = if avail_len < Self::ENCODED_LEN {
10122 payload_buf[0..avail_len].copy_from_slice(__input);
10123 Bytes::new(&payload_buf)
10124 } else {
10125 Bytes::new(__input)
10126 };
10127 let mut __struct = Self::default();
10128 for v in &mut __struct.rc_raw {
10129 let val = buf.get_u8();
10130 *v = val;
10131 }
10132 Ok(__struct)
10133 }
10134 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10135 let mut __tmp = BytesMut::new(bytes);
10136 #[allow(clippy::absurd_extreme_comparisons)]
10137 #[allow(unused_comparisons)]
10138 if __tmp.remaining() < Self::ENCODED_LEN {
10139 panic!(
10140 "buffer is too small (need {} bytes, but got {})",
10141 Self::ENCODED_LEN,
10142 __tmp.remaining(),
10143 )
10144 }
10145 for val in &self.rc_raw {
10146 __tmp.put_u8(*val);
10147 }
10148 if matches!(version, MavlinkVersion::V2) {
10149 let len = __tmp.len();
10150 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10151 } else {
10152 __tmp.len()
10153 }
10154 }
10155}
10156#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10157#[doc = ""]
10158#[doc = "ID: 411"]
10159#[derive(Debug, Clone, PartialEq)]
10160#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10161#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10162#[cfg_attr(feature = "ts", derive(TS))]
10163#[cfg_attr(feature = "ts", ts(export))]
10164pub struct CURRENT_EVENT_SEQUENCE_DATA {
10165 #[doc = "Sequence number."]
10166 pub sequence: u16,
10167 #[doc = "Flag bitset."]
10168 pub flags: MavEventCurrentSequenceFlags,
10169}
10170impl CURRENT_EVENT_SEQUENCE_DATA {
10171 pub const ENCODED_LEN: usize = 3usize;
10172 pub const DEFAULT: Self = Self {
10173 sequence: 0_u16,
10174 flags: MavEventCurrentSequenceFlags::DEFAULT,
10175 };
10176 #[cfg(feature = "arbitrary")]
10177 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10178 use arbitrary::{Arbitrary, Unstructured};
10179 let mut buf = [0u8; 1024];
10180 rng.fill_bytes(&mut buf);
10181 let mut unstructured = Unstructured::new(&buf);
10182 Self::arbitrary(&mut unstructured).unwrap_or_default()
10183 }
10184}
10185impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10186 fn default() -> Self {
10187 Self::DEFAULT.clone()
10188 }
10189}
10190impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10191 type Message = MavMessage;
10192 const ID: u32 = 411u32;
10193 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10194 const EXTRA_CRC: u8 = 106u8;
10195 const ENCODED_LEN: usize = 3usize;
10196 fn deser(
10197 _version: MavlinkVersion,
10198 __input: &[u8],
10199 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10200 let avail_len = __input.len();
10201 let mut payload_buf = [0; Self::ENCODED_LEN];
10202 let mut buf = if avail_len < Self::ENCODED_LEN {
10203 payload_buf[0..avail_len].copy_from_slice(__input);
10204 Bytes::new(&payload_buf)
10205 } else {
10206 Bytes::new(__input)
10207 };
10208 let mut __struct = Self::default();
10209 __struct.sequence = buf.get_u16_le();
10210 let tmp = buf.get_u8();
10211 __struct.flags =
10212 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10213 enum_type: "MavEventCurrentSequenceFlags",
10214 value: tmp as u32,
10215 })?;
10216 Ok(__struct)
10217 }
10218 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10219 let mut __tmp = BytesMut::new(bytes);
10220 #[allow(clippy::absurd_extreme_comparisons)]
10221 #[allow(unused_comparisons)]
10222 if __tmp.remaining() < Self::ENCODED_LEN {
10223 panic!(
10224 "buffer is too small (need {} bytes, but got {})",
10225 Self::ENCODED_LEN,
10226 __tmp.remaining(),
10227 )
10228 }
10229 __tmp.put_u16_le(self.sequence);
10230 __tmp.put_u8(self.flags as u8);
10231 if matches!(version, MavlinkVersion::V2) {
10232 let len = __tmp.len();
10233 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10234 } else {
10235 __tmp.len()
10236 }
10237 }
10238}
10239#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10240#[doc = ""]
10241#[doc = "ID: 436"]
10242#[derive(Debug, Clone, PartialEq)]
10243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10245#[cfg_attr(feature = "ts", derive(TS))]
10246#[cfg_attr(feature = "ts", ts(export))]
10247pub struct CURRENT_MODE_DATA {
10248 #[doc = "A bitfield for use for autopilot-specific flags"]
10249 pub custom_mode: u32,
10250 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10251 pub intended_custom_mode: u32,
10252 #[doc = "Standard mode."]
10253 pub standard_mode: MavStandardMode,
10254}
10255impl CURRENT_MODE_DATA {
10256 pub const ENCODED_LEN: usize = 9usize;
10257 pub const DEFAULT: Self = Self {
10258 custom_mode: 0_u32,
10259 intended_custom_mode: 0_u32,
10260 standard_mode: MavStandardMode::DEFAULT,
10261 };
10262 #[cfg(feature = "arbitrary")]
10263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10264 use arbitrary::{Arbitrary, Unstructured};
10265 let mut buf = [0u8; 1024];
10266 rng.fill_bytes(&mut buf);
10267 let mut unstructured = Unstructured::new(&buf);
10268 Self::arbitrary(&mut unstructured).unwrap_or_default()
10269 }
10270}
10271impl Default for CURRENT_MODE_DATA {
10272 fn default() -> Self {
10273 Self::DEFAULT.clone()
10274 }
10275}
10276impl MessageData for CURRENT_MODE_DATA {
10277 type Message = MavMessage;
10278 const ID: u32 = 436u32;
10279 const NAME: &'static str = "CURRENT_MODE";
10280 const EXTRA_CRC: u8 = 193u8;
10281 const ENCODED_LEN: usize = 9usize;
10282 fn deser(
10283 _version: MavlinkVersion,
10284 __input: &[u8],
10285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10286 let avail_len = __input.len();
10287 let mut payload_buf = [0; Self::ENCODED_LEN];
10288 let mut buf = if avail_len < Self::ENCODED_LEN {
10289 payload_buf[0..avail_len].copy_from_slice(__input);
10290 Bytes::new(&payload_buf)
10291 } else {
10292 Bytes::new(__input)
10293 };
10294 let mut __struct = Self::default();
10295 __struct.custom_mode = buf.get_u32_le();
10296 __struct.intended_custom_mode = buf.get_u32_le();
10297 let tmp = buf.get_u8();
10298 __struct.standard_mode =
10299 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10300 enum_type: "MavStandardMode",
10301 value: tmp as u32,
10302 })?;
10303 Ok(__struct)
10304 }
10305 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10306 let mut __tmp = BytesMut::new(bytes);
10307 #[allow(clippy::absurd_extreme_comparisons)]
10308 #[allow(unused_comparisons)]
10309 if __tmp.remaining() < Self::ENCODED_LEN {
10310 panic!(
10311 "buffer is too small (need {} bytes, but got {})",
10312 Self::ENCODED_LEN,
10313 __tmp.remaining(),
10314 )
10315 }
10316 __tmp.put_u32_le(self.custom_mode);
10317 __tmp.put_u32_le(self.intended_custom_mode);
10318 __tmp.put_u8(self.standard_mode as u8);
10319 if matches!(version, MavlinkVersion::V2) {
10320 let len = __tmp.len();
10321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10322 } else {
10323 __tmp.len()
10324 }
10325 }
10326}
10327#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10328#[doc = "Data stream status information."]
10329#[doc = ""]
10330#[doc = "ID: 67"]
10331#[derive(Debug, Clone, PartialEq)]
10332#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10334#[cfg_attr(feature = "ts", derive(TS))]
10335#[cfg_attr(feature = "ts", ts(export))]
10336pub struct DATA_STREAM_DATA {
10337 #[doc = "The message rate"]
10338 pub message_rate: u16,
10339 #[doc = "The ID of the requested data stream"]
10340 pub stream_id: u8,
10341 #[doc = "1 stream is enabled, 0 stream is stopped."]
10342 pub on_off: u8,
10343}
10344impl DATA_STREAM_DATA {
10345 pub const ENCODED_LEN: usize = 4usize;
10346 pub const DEFAULT: Self = Self {
10347 message_rate: 0_u16,
10348 stream_id: 0_u8,
10349 on_off: 0_u8,
10350 };
10351 #[cfg(feature = "arbitrary")]
10352 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10353 use arbitrary::{Arbitrary, Unstructured};
10354 let mut buf = [0u8; 1024];
10355 rng.fill_bytes(&mut buf);
10356 let mut unstructured = Unstructured::new(&buf);
10357 Self::arbitrary(&mut unstructured).unwrap_or_default()
10358 }
10359}
10360impl Default for DATA_STREAM_DATA {
10361 fn default() -> Self {
10362 Self::DEFAULT.clone()
10363 }
10364}
10365impl MessageData for DATA_STREAM_DATA {
10366 type Message = MavMessage;
10367 const ID: u32 = 67u32;
10368 const NAME: &'static str = "DATA_STREAM";
10369 const EXTRA_CRC: u8 = 21u8;
10370 const ENCODED_LEN: usize = 4usize;
10371 fn deser(
10372 _version: MavlinkVersion,
10373 __input: &[u8],
10374 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10375 let avail_len = __input.len();
10376 let mut payload_buf = [0; Self::ENCODED_LEN];
10377 let mut buf = if avail_len < Self::ENCODED_LEN {
10378 payload_buf[0..avail_len].copy_from_slice(__input);
10379 Bytes::new(&payload_buf)
10380 } else {
10381 Bytes::new(__input)
10382 };
10383 let mut __struct = Self::default();
10384 __struct.message_rate = buf.get_u16_le();
10385 __struct.stream_id = buf.get_u8();
10386 __struct.on_off = buf.get_u8();
10387 Ok(__struct)
10388 }
10389 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10390 let mut __tmp = BytesMut::new(bytes);
10391 #[allow(clippy::absurd_extreme_comparisons)]
10392 #[allow(unused_comparisons)]
10393 if __tmp.remaining() < Self::ENCODED_LEN {
10394 panic!(
10395 "buffer is too small (need {} bytes, but got {})",
10396 Self::ENCODED_LEN,
10397 __tmp.remaining(),
10398 )
10399 }
10400 __tmp.put_u16_le(self.message_rate);
10401 __tmp.put_u8(self.stream_id);
10402 __tmp.put_u8(self.on_off);
10403 if matches!(version, MavlinkVersion::V2) {
10404 let len = __tmp.len();
10405 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10406 } else {
10407 __tmp.len()
10408 }
10409 }
10410}
10411#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10412#[doc = ""]
10413#[doc = "ID: 130"]
10414#[derive(Debug, Clone, PartialEq)]
10415#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10416#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10417#[cfg_attr(feature = "ts", derive(TS))]
10418#[cfg_attr(feature = "ts", ts(export))]
10419pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10420 #[doc = "total data size (set on ACK only)."]
10421 pub size: u32,
10422 #[doc = "Width of a matrix or image."]
10423 pub width: u16,
10424 #[doc = "Height of a matrix or image."]
10425 pub height: u16,
10426 #[doc = "Number of packets being sent (set on ACK only)."]
10427 pub packets: u16,
10428 #[doc = "Type of requested/acknowledged data."]
10429 pub mavtype: MavlinkDataStreamType,
10430 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10431 pub payload: u8,
10432 #[doc = "JPEG quality. Values: [1-100]."]
10433 pub jpg_quality: u8,
10434}
10435impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10436 pub const ENCODED_LEN: usize = 13usize;
10437 pub const DEFAULT: Self = Self {
10438 size: 0_u32,
10439 width: 0_u16,
10440 height: 0_u16,
10441 packets: 0_u16,
10442 mavtype: MavlinkDataStreamType::DEFAULT,
10443 payload: 0_u8,
10444 jpg_quality: 0_u8,
10445 };
10446 #[cfg(feature = "arbitrary")]
10447 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10448 use arbitrary::{Arbitrary, Unstructured};
10449 let mut buf = [0u8; 1024];
10450 rng.fill_bytes(&mut buf);
10451 let mut unstructured = Unstructured::new(&buf);
10452 Self::arbitrary(&mut unstructured).unwrap_or_default()
10453 }
10454}
10455impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10456 fn default() -> Self {
10457 Self::DEFAULT.clone()
10458 }
10459}
10460impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10461 type Message = MavMessage;
10462 const ID: u32 = 130u32;
10463 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10464 const EXTRA_CRC: u8 = 29u8;
10465 const ENCODED_LEN: usize = 13usize;
10466 fn deser(
10467 _version: MavlinkVersion,
10468 __input: &[u8],
10469 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10470 let avail_len = __input.len();
10471 let mut payload_buf = [0; Self::ENCODED_LEN];
10472 let mut buf = if avail_len < Self::ENCODED_LEN {
10473 payload_buf[0..avail_len].copy_from_slice(__input);
10474 Bytes::new(&payload_buf)
10475 } else {
10476 Bytes::new(__input)
10477 };
10478 let mut __struct = Self::default();
10479 __struct.size = buf.get_u32_le();
10480 __struct.width = buf.get_u16_le();
10481 __struct.height = buf.get_u16_le();
10482 __struct.packets = buf.get_u16_le();
10483 let tmp = buf.get_u8();
10484 __struct.mavtype =
10485 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10486 enum_type: "MavlinkDataStreamType",
10487 value: tmp as u32,
10488 })?;
10489 __struct.payload = buf.get_u8();
10490 __struct.jpg_quality = buf.get_u8();
10491 Ok(__struct)
10492 }
10493 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10494 let mut __tmp = BytesMut::new(bytes);
10495 #[allow(clippy::absurd_extreme_comparisons)]
10496 #[allow(unused_comparisons)]
10497 if __tmp.remaining() < Self::ENCODED_LEN {
10498 panic!(
10499 "buffer is too small (need {} bytes, but got {})",
10500 Self::ENCODED_LEN,
10501 __tmp.remaining(),
10502 )
10503 }
10504 __tmp.put_u32_le(self.size);
10505 __tmp.put_u16_le(self.width);
10506 __tmp.put_u16_le(self.height);
10507 __tmp.put_u16_le(self.packets);
10508 __tmp.put_u8(self.mavtype as u8);
10509 __tmp.put_u8(self.payload);
10510 __tmp.put_u8(self.jpg_quality);
10511 if matches!(version, MavlinkVersion::V2) {
10512 let len = __tmp.len();
10513 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10514 } else {
10515 __tmp.len()
10516 }
10517 }
10518}
10519#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10520#[doc = ""]
10521#[doc = "ID: 254"]
10522#[derive(Debug, Clone, PartialEq)]
10523#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10524#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10525#[cfg_attr(feature = "ts", derive(TS))]
10526#[cfg_attr(feature = "ts", ts(export))]
10527pub struct DEBUG_DATA {
10528 #[doc = "Timestamp (time since system boot)."]
10529 pub time_boot_ms: u32,
10530 #[doc = "DEBUG value"]
10531 pub value: f32,
10532 #[doc = "index of debug variable"]
10533 pub ind: u8,
10534}
10535impl DEBUG_DATA {
10536 pub const ENCODED_LEN: usize = 9usize;
10537 pub const DEFAULT: Self = Self {
10538 time_boot_ms: 0_u32,
10539 value: 0.0_f32,
10540 ind: 0_u8,
10541 };
10542 #[cfg(feature = "arbitrary")]
10543 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10544 use arbitrary::{Arbitrary, Unstructured};
10545 let mut buf = [0u8; 1024];
10546 rng.fill_bytes(&mut buf);
10547 let mut unstructured = Unstructured::new(&buf);
10548 Self::arbitrary(&mut unstructured).unwrap_or_default()
10549 }
10550}
10551impl Default for DEBUG_DATA {
10552 fn default() -> Self {
10553 Self::DEFAULT.clone()
10554 }
10555}
10556impl MessageData for DEBUG_DATA {
10557 type Message = MavMessage;
10558 const ID: u32 = 254u32;
10559 const NAME: &'static str = "DEBUG";
10560 const EXTRA_CRC: u8 = 46u8;
10561 const ENCODED_LEN: usize = 9usize;
10562 fn deser(
10563 _version: MavlinkVersion,
10564 __input: &[u8],
10565 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10566 let avail_len = __input.len();
10567 let mut payload_buf = [0; Self::ENCODED_LEN];
10568 let mut buf = if avail_len < Self::ENCODED_LEN {
10569 payload_buf[0..avail_len].copy_from_slice(__input);
10570 Bytes::new(&payload_buf)
10571 } else {
10572 Bytes::new(__input)
10573 };
10574 let mut __struct = Self::default();
10575 __struct.time_boot_ms = buf.get_u32_le();
10576 __struct.value = buf.get_f32_le();
10577 __struct.ind = buf.get_u8();
10578 Ok(__struct)
10579 }
10580 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10581 let mut __tmp = BytesMut::new(bytes);
10582 #[allow(clippy::absurd_extreme_comparisons)]
10583 #[allow(unused_comparisons)]
10584 if __tmp.remaining() < Self::ENCODED_LEN {
10585 panic!(
10586 "buffer is too small (need {} bytes, but got {})",
10587 Self::ENCODED_LEN,
10588 __tmp.remaining(),
10589 )
10590 }
10591 __tmp.put_u32_le(self.time_boot_ms);
10592 __tmp.put_f32_le(self.value);
10593 __tmp.put_u8(self.ind);
10594 if matches!(version, MavlinkVersion::V2) {
10595 let len = __tmp.len();
10596 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10597 } else {
10598 __tmp.len()
10599 }
10600 }
10601}
10602#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10603#[doc = ""]
10604#[doc = "ID: 350"]
10605#[derive(Debug, Clone, PartialEq)]
10606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10607#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10608#[cfg_attr(feature = "ts", derive(TS))]
10609#[cfg_attr(feature = "ts", ts(export))]
10610pub struct DEBUG_FLOAT_ARRAY_DATA {
10611 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10612 pub time_usec: u64,
10613 #[doc = "Unique ID used to discriminate between arrays"]
10614 pub array_id: u16,
10615 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10616 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10617 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10618 pub name: [u8; 10],
10619 #[doc = "data"]
10620 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10621 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10622 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10623 pub data: [f32; 58],
10624}
10625impl DEBUG_FLOAT_ARRAY_DATA {
10626 pub const ENCODED_LEN: usize = 252usize;
10627 pub const DEFAULT: Self = Self {
10628 time_usec: 0_u64,
10629 array_id: 0_u16,
10630 name: [0_u8; 10usize],
10631 data: [0.0_f32; 58usize],
10632 };
10633 #[cfg(feature = "arbitrary")]
10634 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10635 use arbitrary::{Arbitrary, Unstructured};
10636 let mut buf = [0u8; 1024];
10637 rng.fill_bytes(&mut buf);
10638 let mut unstructured = Unstructured::new(&buf);
10639 Self::arbitrary(&mut unstructured).unwrap_or_default()
10640 }
10641}
10642impl Default for DEBUG_FLOAT_ARRAY_DATA {
10643 fn default() -> Self {
10644 Self::DEFAULT.clone()
10645 }
10646}
10647impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10648 type Message = MavMessage;
10649 const ID: u32 = 350u32;
10650 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10651 const EXTRA_CRC: u8 = 232u8;
10652 const ENCODED_LEN: usize = 252usize;
10653 fn deser(
10654 _version: MavlinkVersion,
10655 __input: &[u8],
10656 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10657 let avail_len = __input.len();
10658 let mut payload_buf = [0; Self::ENCODED_LEN];
10659 let mut buf = if avail_len < Self::ENCODED_LEN {
10660 payload_buf[0..avail_len].copy_from_slice(__input);
10661 Bytes::new(&payload_buf)
10662 } else {
10663 Bytes::new(__input)
10664 };
10665 let mut __struct = Self::default();
10666 __struct.time_usec = buf.get_u64_le();
10667 __struct.array_id = buf.get_u16_le();
10668 for v in &mut __struct.name {
10669 let val = buf.get_u8();
10670 *v = val;
10671 }
10672 for v in &mut __struct.data {
10673 let val = buf.get_f32_le();
10674 *v = val;
10675 }
10676 Ok(__struct)
10677 }
10678 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10679 let mut __tmp = BytesMut::new(bytes);
10680 #[allow(clippy::absurd_extreme_comparisons)]
10681 #[allow(unused_comparisons)]
10682 if __tmp.remaining() < Self::ENCODED_LEN {
10683 panic!(
10684 "buffer is too small (need {} bytes, but got {})",
10685 Self::ENCODED_LEN,
10686 __tmp.remaining(),
10687 )
10688 }
10689 __tmp.put_u64_le(self.time_usec);
10690 __tmp.put_u16_le(self.array_id);
10691 for val in &self.name {
10692 __tmp.put_u8(*val);
10693 }
10694 if matches!(version, MavlinkVersion::V2) {
10695 for val in &self.data {
10696 __tmp.put_f32_le(*val);
10697 }
10698 let len = __tmp.len();
10699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10700 } else {
10701 __tmp.len()
10702 }
10703 }
10704}
10705#[doc = "To debug something using a named 3D vector."]
10706#[doc = ""]
10707#[doc = "ID: 250"]
10708#[derive(Debug, Clone, PartialEq)]
10709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10711#[cfg_attr(feature = "ts", derive(TS))]
10712#[cfg_attr(feature = "ts", ts(export))]
10713pub struct DEBUG_VECT_DATA {
10714 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10715 pub time_usec: u64,
10716 #[doc = "x"]
10717 pub x: f32,
10718 #[doc = "y"]
10719 pub y: f32,
10720 #[doc = "z"]
10721 pub z: f32,
10722 #[doc = "Name"]
10723 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10724 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10725 pub name: [u8; 10],
10726}
10727impl DEBUG_VECT_DATA {
10728 pub const ENCODED_LEN: usize = 30usize;
10729 pub const DEFAULT: Self = Self {
10730 time_usec: 0_u64,
10731 x: 0.0_f32,
10732 y: 0.0_f32,
10733 z: 0.0_f32,
10734 name: [0_u8; 10usize],
10735 };
10736 #[cfg(feature = "arbitrary")]
10737 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10738 use arbitrary::{Arbitrary, Unstructured};
10739 let mut buf = [0u8; 1024];
10740 rng.fill_bytes(&mut buf);
10741 let mut unstructured = Unstructured::new(&buf);
10742 Self::arbitrary(&mut unstructured).unwrap_or_default()
10743 }
10744}
10745impl Default for DEBUG_VECT_DATA {
10746 fn default() -> Self {
10747 Self::DEFAULT.clone()
10748 }
10749}
10750impl MessageData for DEBUG_VECT_DATA {
10751 type Message = MavMessage;
10752 const ID: u32 = 250u32;
10753 const NAME: &'static str = "DEBUG_VECT";
10754 const EXTRA_CRC: u8 = 49u8;
10755 const ENCODED_LEN: usize = 30usize;
10756 fn deser(
10757 _version: MavlinkVersion,
10758 __input: &[u8],
10759 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10760 let avail_len = __input.len();
10761 let mut payload_buf = [0; Self::ENCODED_LEN];
10762 let mut buf = if avail_len < Self::ENCODED_LEN {
10763 payload_buf[0..avail_len].copy_from_slice(__input);
10764 Bytes::new(&payload_buf)
10765 } else {
10766 Bytes::new(__input)
10767 };
10768 let mut __struct = Self::default();
10769 __struct.time_usec = buf.get_u64_le();
10770 __struct.x = buf.get_f32_le();
10771 __struct.y = buf.get_f32_le();
10772 __struct.z = buf.get_f32_le();
10773 for v in &mut __struct.name {
10774 let val = buf.get_u8();
10775 *v = val;
10776 }
10777 Ok(__struct)
10778 }
10779 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10780 let mut __tmp = BytesMut::new(bytes);
10781 #[allow(clippy::absurd_extreme_comparisons)]
10782 #[allow(unused_comparisons)]
10783 if __tmp.remaining() < Self::ENCODED_LEN {
10784 panic!(
10785 "buffer is too small (need {} bytes, but got {})",
10786 Self::ENCODED_LEN,
10787 __tmp.remaining(),
10788 )
10789 }
10790 __tmp.put_u64_le(self.time_usec);
10791 __tmp.put_f32_le(self.x);
10792 __tmp.put_f32_le(self.y);
10793 __tmp.put_f32_le(self.z);
10794 for val in &self.name {
10795 __tmp.put_u8(*val);
10796 }
10797 if matches!(version, MavlinkVersion::V2) {
10798 let len = __tmp.len();
10799 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10800 } else {
10801 __tmp.len()
10802 }
10803 }
10804}
10805#[doc = "Distance sensor information for an onboard rangefinder."]
10806#[doc = ""]
10807#[doc = "ID: 132"]
10808#[derive(Debug, Clone, PartialEq)]
10809#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10810#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10811#[cfg_attr(feature = "ts", derive(TS))]
10812#[cfg_attr(feature = "ts", ts(export))]
10813pub struct DISTANCE_SENSOR_DATA {
10814 #[doc = "Timestamp (time since system boot)."]
10815 pub time_boot_ms: u32,
10816 #[doc = "Minimum distance the sensor can measure"]
10817 pub min_distance: u16,
10818 #[doc = "Maximum distance the sensor can measure"]
10819 pub max_distance: u16,
10820 #[doc = "Current distance reading"]
10821 pub current_distance: u16,
10822 #[doc = "Type of distance sensor."]
10823 pub mavtype: MavDistanceSensor,
10824 #[doc = "Onboard ID of the sensor"]
10825 pub id: u8,
10826 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10827 pub orientation: MavSensorOrientation,
10828 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10829 pub covariance: u8,
10830 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10831 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10832 pub horizontal_fov: f32,
10833 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10834 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10835 pub vertical_fov: f32,
10836 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10837 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10838 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10839 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10840 pub quaternion: [f32; 4],
10841 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10842 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10843 pub signal_quality: u8,
10844}
10845impl DISTANCE_SENSOR_DATA {
10846 pub const ENCODED_LEN: usize = 39usize;
10847 pub const DEFAULT: Self = Self {
10848 time_boot_ms: 0_u32,
10849 min_distance: 0_u16,
10850 max_distance: 0_u16,
10851 current_distance: 0_u16,
10852 mavtype: MavDistanceSensor::DEFAULT,
10853 id: 0_u8,
10854 orientation: MavSensorOrientation::DEFAULT,
10855 covariance: 0_u8,
10856 horizontal_fov: 0.0_f32,
10857 vertical_fov: 0.0_f32,
10858 quaternion: [0.0_f32; 4usize],
10859 signal_quality: 0_u8,
10860 };
10861 #[cfg(feature = "arbitrary")]
10862 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10863 use arbitrary::{Arbitrary, Unstructured};
10864 let mut buf = [0u8; 1024];
10865 rng.fill_bytes(&mut buf);
10866 let mut unstructured = Unstructured::new(&buf);
10867 Self::arbitrary(&mut unstructured).unwrap_or_default()
10868 }
10869}
10870impl Default for DISTANCE_SENSOR_DATA {
10871 fn default() -> Self {
10872 Self::DEFAULT.clone()
10873 }
10874}
10875impl MessageData for DISTANCE_SENSOR_DATA {
10876 type Message = MavMessage;
10877 const ID: u32 = 132u32;
10878 const NAME: &'static str = "DISTANCE_SENSOR";
10879 const EXTRA_CRC: u8 = 85u8;
10880 const ENCODED_LEN: usize = 39usize;
10881 fn deser(
10882 _version: MavlinkVersion,
10883 __input: &[u8],
10884 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10885 let avail_len = __input.len();
10886 let mut payload_buf = [0; Self::ENCODED_LEN];
10887 let mut buf = if avail_len < Self::ENCODED_LEN {
10888 payload_buf[0..avail_len].copy_from_slice(__input);
10889 Bytes::new(&payload_buf)
10890 } else {
10891 Bytes::new(__input)
10892 };
10893 let mut __struct = Self::default();
10894 __struct.time_boot_ms = buf.get_u32_le();
10895 __struct.min_distance = buf.get_u16_le();
10896 __struct.max_distance = buf.get_u16_le();
10897 __struct.current_distance = buf.get_u16_le();
10898 let tmp = buf.get_u8();
10899 __struct.mavtype =
10900 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10901 enum_type: "MavDistanceSensor",
10902 value: tmp as u32,
10903 })?;
10904 __struct.id = buf.get_u8();
10905 let tmp = buf.get_u8();
10906 __struct.orientation =
10907 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10908 enum_type: "MavSensorOrientation",
10909 value: tmp as u32,
10910 })?;
10911 __struct.covariance = buf.get_u8();
10912 __struct.horizontal_fov = buf.get_f32_le();
10913 __struct.vertical_fov = buf.get_f32_le();
10914 for v in &mut __struct.quaternion {
10915 let val = buf.get_f32_le();
10916 *v = val;
10917 }
10918 __struct.signal_quality = buf.get_u8();
10919 Ok(__struct)
10920 }
10921 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10922 let mut __tmp = BytesMut::new(bytes);
10923 #[allow(clippy::absurd_extreme_comparisons)]
10924 #[allow(unused_comparisons)]
10925 if __tmp.remaining() < Self::ENCODED_LEN {
10926 panic!(
10927 "buffer is too small (need {} bytes, but got {})",
10928 Self::ENCODED_LEN,
10929 __tmp.remaining(),
10930 )
10931 }
10932 __tmp.put_u32_le(self.time_boot_ms);
10933 __tmp.put_u16_le(self.min_distance);
10934 __tmp.put_u16_le(self.max_distance);
10935 __tmp.put_u16_le(self.current_distance);
10936 __tmp.put_u8(self.mavtype as u8);
10937 __tmp.put_u8(self.id);
10938 __tmp.put_u8(self.orientation as u8);
10939 __tmp.put_u8(self.covariance);
10940 if matches!(version, MavlinkVersion::V2) {
10941 __tmp.put_f32_le(self.horizontal_fov);
10942 __tmp.put_f32_le(self.vertical_fov);
10943 for val in &self.quaternion {
10944 __tmp.put_f32_le(*val);
10945 }
10946 __tmp.put_u8(self.signal_quality);
10947 let len = __tmp.len();
10948 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10949 } else {
10950 __tmp.len()
10951 }
10952 }
10953}
10954#[doc = "EFI status output."]
10955#[doc = ""]
10956#[doc = "ID: 225"]
10957#[derive(Debug, Clone, PartialEq)]
10958#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10959#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10960#[cfg_attr(feature = "ts", derive(TS))]
10961#[cfg_attr(feature = "ts", ts(export))]
10962pub struct EFI_STATUS_DATA {
10963 #[doc = "ECU index"]
10964 pub ecu_index: f32,
10965 #[doc = "RPM"]
10966 pub rpm: f32,
10967 #[doc = "Fuel consumed"]
10968 pub fuel_consumed: f32,
10969 #[doc = "Fuel flow rate"]
10970 pub fuel_flow: f32,
10971 #[doc = "Engine load"]
10972 pub engine_load: f32,
10973 #[doc = "Throttle position"]
10974 pub throttle_position: f32,
10975 #[doc = "Spark dwell time"]
10976 pub spark_dwell_time: f32,
10977 #[doc = "Barometric pressure"]
10978 pub barometric_pressure: f32,
10979 #[doc = "Intake manifold pressure("]
10980 pub intake_manifold_pressure: f32,
10981 #[doc = "Intake manifold temperature"]
10982 pub intake_manifold_temperature: f32,
10983 #[doc = "Cylinder head temperature"]
10984 pub cylinder_head_temperature: f32,
10985 #[doc = "Ignition timing (Crank angle degrees)"]
10986 pub ignition_timing: f32,
10987 #[doc = "Injection time"]
10988 pub injection_time: f32,
10989 #[doc = "Exhaust gas temperature"]
10990 pub exhaust_gas_temperature: f32,
10991 #[doc = "Output throttle"]
10992 pub throttle_out: f32,
10993 #[doc = "Pressure/temperature compensation"]
10994 pub pt_compensation: f32,
10995 #[doc = "EFI health status"]
10996 pub health: u8,
10997 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10998 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10999 pub ignition_voltage: f32,
11000 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
11001 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11002 pub fuel_pressure: f32,
11003}
11004impl EFI_STATUS_DATA {
11005 pub const ENCODED_LEN: usize = 73usize;
11006 pub const DEFAULT: Self = Self {
11007 ecu_index: 0.0_f32,
11008 rpm: 0.0_f32,
11009 fuel_consumed: 0.0_f32,
11010 fuel_flow: 0.0_f32,
11011 engine_load: 0.0_f32,
11012 throttle_position: 0.0_f32,
11013 spark_dwell_time: 0.0_f32,
11014 barometric_pressure: 0.0_f32,
11015 intake_manifold_pressure: 0.0_f32,
11016 intake_manifold_temperature: 0.0_f32,
11017 cylinder_head_temperature: 0.0_f32,
11018 ignition_timing: 0.0_f32,
11019 injection_time: 0.0_f32,
11020 exhaust_gas_temperature: 0.0_f32,
11021 throttle_out: 0.0_f32,
11022 pt_compensation: 0.0_f32,
11023 health: 0_u8,
11024 ignition_voltage: 0.0_f32,
11025 fuel_pressure: 0.0_f32,
11026 };
11027 #[cfg(feature = "arbitrary")]
11028 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11029 use arbitrary::{Arbitrary, Unstructured};
11030 let mut buf = [0u8; 1024];
11031 rng.fill_bytes(&mut buf);
11032 let mut unstructured = Unstructured::new(&buf);
11033 Self::arbitrary(&mut unstructured).unwrap_or_default()
11034 }
11035}
11036impl Default for EFI_STATUS_DATA {
11037 fn default() -> Self {
11038 Self::DEFAULT.clone()
11039 }
11040}
11041impl MessageData for EFI_STATUS_DATA {
11042 type Message = MavMessage;
11043 const ID: u32 = 225u32;
11044 const NAME: &'static str = "EFI_STATUS";
11045 const EXTRA_CRC: u8 = 208u8;
11046 const ENCODED_LEN: usize = 73usize;
11047 fn deser(
11048 _version: MavlinkVersion,
11049 __input: &[u8],
11050 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11051 let avail_len = __input.len();
11052 let mut payload_buf = [0; Self::ENCODED_LEN];
11053 let mut buf = if avail_len < Self::ENCODED_LEN {
11054 payload_buf[0..avail_len].copy_from_slice(__input);
11055 Bytes::new(&payload_buf)
11056 } else {
11057 Bytes::new(__input)
11058 };
11059 let mut __struct = Self::default();
11060 __struct.ecu_index = buf.get_f32_le();
11061 __struct.rpm = buf.get_f32_le();
11062 __struct.fuel_consumed = buf.get_f32_le();
11063 __struct.fuel_flow = buf.get_f32_le();
11064 __struct.engine_load = buf.get_f32_le();
11065 __struct.throttle_position = buf.get_f32_le();
11066 __struct.spark_dwell_time = buf.get_f32_le();
11067 __struct.barometric_pressure = buf.get_f32_le();
11068 __struct.intake_manifold_pressure = buf.get_f32_le();
11069 __struct.intake_manifold_temperature = buf.get_f32_le();
11070 __struct.cylinder_head_temperature = buf.get_f32_le();
11071 __struct.ignition_timing = buf.get_f32_le();
11072 __struct.injection_time = buf.get_f32_le();
11073 __struct.exhaust_gas_temperature = buf.get_f32_le();
11074 __struct.throttle_out = buf.get_f32_le();
11075 __struct.pt_compensation = buf.get_f32_le();
11076 __struct.health = buf.get_u8();
11077 __struct.ignition_voltage = buf.get_f32_le();
11078 __struct.fuel_pressure = buf.get_f32_le();
11079 Ok(__struct)
11080 }
11081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11082 let mut __tmp = BytesMut::new(bytes);
11083 #[allow(clippy::absurd_extreme_comparisons)]
11084 #[allow(unused_comparisons)]
11085 if __tmp.remaining() < Self::ENCODED_LEN {
11086 panic!(
11087 "buffer is too small (need {} bytes, but got {})",
11088 Self::ENCODED_LEN,
11089 __tmp.remaining(),
11090 )
11091 }
11092 __tmp.put_f32_le(self.ecu_index);
11093 __tmp.put_f32_le(self.rpm);
11094 __tmp.put_f32_le(self.fuel_consumed);
11095 __tmp.put_f32_le(self.fuel_flow);
11096 __tmp.put_f32_le(self.engine_load);
11097 __tmp.put_f32_le(self.throttle_position);
11098 __tmp.put_f32_le(self.spark_dwell_time);
11099 __tmp.put_f32_le(self.barometric_pressure);
11100 __tmp.put_f32_le(self.intake_manifold_pressure);
11101 __tmp.put_f32_le(self.intake_manifold_temperature);
11102 __tmp.put_f32_le(self.cylinder_head_temperature);
11103 __tmp.put_f32_le(self.ignition_timing);
11104 __tmp.put_f32_le(self.injection_time);
11105 __tmp.put_f32_le(self.exhaust_gas_temperature);
11106 __tmp.put_f32_le(self.throttle_out);
11107 __tmp.put_f32_le(self.pt_compensation);
11108 __tmp.put_u8(self.health);
11109 if matches!(version, MavlinkVersion::V2) {
11110 __tmp.put_f32_le(self.ignition_voltage);
11111 __tmp.put_f32_le(self.fuel_pressure);
11112 let len = __tmp.len();
11113 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11114 } else {
11115 __tmp.len()
11116 }
11117 }
11118}
11119#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11120#[doc = ""]
11121#[doc = "ID: 131"]
11122#[derive(Debug, Clone, PartialEq)]
11123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11124#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11125#[cfg_attr(feature = "ts", derive(TS))]
11126#[cfg_attr(feature = "ts", ts(export))]
11127pub struct ENCAPSULATED_DATA_DATA {
11128 #[doc = "sequence number (starting with 0 on every transmission)"]
11129 pub seqnr: u16,
11130 #[doc = "image data bytes"]
11131 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11132 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11133 pub data: [u8; 253],
11134}
11135impl ENCAPSULATED_DATA_DATA {
11136 pub const ENCODED_LEN: usize = 255usize;
11137 pub const DEFAULT: Self = Self {
11138 seqnr: 0_u16,
11139 data: [0_u8; 253usize],
11140 };
11141 #[cfg(feature = "arbitrary")]
11142 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11143 use arbitrary::{Arbitrary, Unstructured};
11144 let mut buf = [0u8; 1024];
11145 rng.fill_bytes(&mut buf);
11146 let mut unstructured = Unstructured::new(&buf);
11147 Self::arbitrary(&mut unstructured).unwrap_or_default()
11148 }
11149}
11150impl Default for ENCAPSULATED_DATA_DATA {
11151 fn default() -> Self {
11152 Self::DEFAULT.clone()
11153 }
11154}
11155impl MessageData for ENCAPSULATED_DATA_DATA {
11156 type Message = MavMessage;
11157 const ID: u32 = 131u32;
11158 const NAME: &'static str = "ENCAPSULATED_DATA";
11159 const EXTRA_CRC: u8 = 223u8;
11160 const ENCODED_LEN: usize = 255usize;
11161 fn deser(
11162 _version: MavlinkVersion,
11163 __input: &[u8],
11164 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11165 let avail_len = __input.len();
11166 let mut payload_buf = [0; Self::ENCODED_LEN];
11167 let mut buf = if avail_len < Self::ENCODED_LEN {
11168 payload_buf[0..avail_len].copy_from_slice(__input);
11169 Bytes::new(&payload_buf)
11170 } else {
11171 Bytes::new(__input)
11172 };
11173 let mut __struct = Self::default();
11174 __struct.seqnr = buf.get_u16_le();
11175 for v in &mut __struct.data {
11176 let val = buf.get_u8();
11177 *v = val;
11178 }
11179 Ok(__struct)
11180 }
11181 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11182 let mut __tmp = BytesMut::new(bytes);
11183 #[allow(clippy::absurd_extreme_comparisons)]
11184 #[allow(unused_comparisons)]
11185 if __tmp.remaining() < Self::ENCODED_LEN {
11186 panic!(
11187 "buffer is too small (need {} bytes, but got {})",
11188 Self::ENCODED_LEN,
11189 __tmp.remaining(),
11190 )
11191 }
11192 __tmp.put_u16_le(self.seqnr);
11193 for val in &self.data {
11194 __tmp.put_u8(*val);
11195 }
11196 if matches!(version, MavlinkVersion::V2) {
11197 let len = __tmp.len();
11198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11199 } else {
11200 __tmp.len()
11201 }
11202 }
11203}
11204#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11205#[doc = ""]
11206#[doc = "ID: 290"]
11207#[derive(Debug, Clone, PartialEq)]
11208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11210#[cfg_attr(feature = "ts", derive(TS))]
11211#[cfg_attr(feature = "ts", ts(export))]
11212pub struct ESC_INFO_DATA {
11213 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11214 pub time_usec: u64,
11215 #[doc = "Number of reported errors by each ESC since boot."]
11216 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11217 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11218 pub error_count: [u32; 4],
11219 #[doc = "Counter of data packets received."]
11220 pub counter: u16,
11221 #[doc = "Bitmap of ESC failure flags."]
11222 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11223 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11224 pub failure_flags: [u16; 4],
11225 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11226 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11227 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11228 pub temperature: [i16; 4],
11229 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11230 pub index: u8,
11231 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11232 pub count: u8,
11233 #[doc = "Connection type protocol for all ESC."]
11234 pub connection_type: EscConnectionType,
11235 #[doc = "Information regarding online/offline status of each ESC."]
11236 pub info: u8,
11237}
11238impl ESC_INFO_DATA {
11239 pub const ENCODED_LEN: usize = 46usize;
11240 pub const DEFAULT: Self = Self {
11241 time_usec: 0_u64,
11242 error_count: [0_u32; 4usize],
11243 counter: 0_u16,
11244 failure_flags: [0_u16; 4usize],
11245 temperature: [0_i16; 4usize],
11246 index: 0_u8,
11247 count: 0_u8,
11248 connection_type: EscConnectionType::DEFAULT,
11249 info: 0_u8,
11250 };
11251 #[cfg(feature = "arbitrary")]
11252 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11253 use arbitrary::{Arbitrary, Unstructured};
11254 let mut buf = [0u8; 1024];
11255 rng.fill_bytes(&mut buf);
11256 let mut unstructured = Unstructured::new(&buf);
11257 Self::arbitrary(&mut unstructured).unwrap_or_default()
11258 }
11259}
11260impl Default for ESC_INFO_DATA {
11261 fn default() -> Self {
11262 Self::DEFAULT.clone()
11263 }
11264}
11265impl MessageData for ESC_INFO_DATA {
11266 type Message = MavMessage;
11267 const ID: u32 = 290u32;
11268 const NAME: &'static str = "ESC_INFO";
11269 const EXTRA_CRC: u8 = 251u8;
11270 const ENCODED_LEN: usize = 46usize;
11271 fn deser(
11272 _version: MavlinkVersion,
11273 __input: &[u8],
11274 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11275 let avail_len = __input.len();
11276 let mut payload_buf = [0; Self::ENCODED_LEN];
11277 let mut buf = if avail_len < Self::ENCODED_LEN {
11278 payload_buf[0..avail_len].copy_from_slice(__input);
11279 Bytes::new(&payload_buf)
11280 } else {
11281 Bytes::new(__input)
11282 };
11283 let mut __struct = Self::default();
11284 __struct.time_usec = buf.get_u64_le();
11285 for v in &mut __struct.error_count {
11286 let val = buf.get_u32_le();
11287 *v = val;
11288 }
11289 __struct.counter = buf.get_u16_le();
11290 for v in &mut __struct.failure_flags {
11291 let val = buf.get_u16_le();
11292 *v = val;
11293 }
11294 for v in &mut __struct.temperature {
11295 let val = buf.get_i16_le();
11296 *v = val;
11297 }
11298 __struct.index = buf.get_u8();
11299 __struct.count = buf.get_u8();
11300 let tmp = buf.get_u8();
11301 __struct.connection_type =
11302 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11303 enum_type: "EscConnectionType",
11304 value: tmp as u32,
11305 })?;
11306 __struct.info = buf.get_u8();
11307 Ok(__struct)
11308 }
11309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11310 let mut __tmp = BytesMut::new(bytes);
11311 #[allow(clippy::absurd_extreme_comparisons)]
11312 #[allow(unused_comparisons)]
11313 if __tmp.remaining() < Self::ENCODED_LEN {
11314 panic!(
11315 "buffer is too small (need {} bytes, but got {})",
11316 Self::ENCODED_LEN,
11317 __tmp.remaining(),
11318 )
11319 }
11320 __tmp.put_u64_le(self.time_usec);
11321 for val in &self.error_count {
11322 __tmp.put_u32_le(*val);
11323 }
11324 __tmp.put_u16_le(self.counter);
11325 for val in &self.failure_flags {
11326 __tmp.put_u16_le(*val);
11327 }
11328 for val in &self.temperature {
11329 __tmp.put_i16_le(*val);
11330 }
11331 __tmp.put_u8(self.index);
11332 __tmp.put_u8(self.count);
11333 __tmp.put_u8(self.connection_type as u8);
11334 __tmp.put_u8(self.info);
11335 if matches!(version, MavlinkVersion::V2) {
11336 let len = __tmp.len();
11337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11338 } else {
11339 __tmp.len()
11340 }
11341 }
11342}
11343#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11344#[doc = ""]
11345#[doc = "ID: 291"]
11346#[derive(Debug, Clone, PartialEq)]
11347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11349#[cfg_attr(feature = "ts", derive(TS))]
11350#[cfg_attr(feature = "ts", ts(export))]
11351pub struct ESC_STATUS_DATA {
11352 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11353 pub time_usec: u64,
11354 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11355 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11356 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11357 pub rpm: [i32; 4],
11358 #[doc = "Voltage measured from each ESC."]
11359 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11360 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11361 pub voltage: [f32; 4],
11362 #[doc = "Current measured from each ESC."]
11363 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11364 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11365 pub current: [f32; 4],
11366 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11367 pub index: u8,
11368}
11369impl ESC_STATUS_DATA {
11370 pub const ENCODED_LEN: usize = 57usize;
11371 pub const DEFAULT: Self = Self {
11372 time_usec: 0_u64,
11373 rpm: [0_i32; 4usize],
11374 voltage: [0.0_f32; 4usize],
11375 current: [0.0_f32; 4usize],
11376 index: 0_u8,
11377 };
11378 #[cfg(feature = "arbitrary")]
11379 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11380 use arbitrary::{Arbitrary, Unstructured};
11381 let mut buf = [0u8; 1024];
11382 rng.fill_bytes(&mut buf);
11383 let mut unstructured = Unstructured::new(&buf);
11384 Self::arbitrary(&mut unstructured).unwrap_or_default()
11385 }
11386}
11387impl Default for ESC_STATUS_DATA {
11388 fn default() -> Self {
11389 Self::DEFAULT.clone()
11390 }
11391}
11392impl MessageData for ESC_STATUS_DATA {
11393 type Message = MavMessage;
11394 const ID: u32 = 291u32;
11395 const NAME: &'static str = "ESC_STATUS";
11396 const EXTRA_CRC: u8 = 10u8;
11397 const ENCODED_LEN: usize = 57usize;
11398 fn deser(
11399 _version: MavlinkVersion,
11400 __input: &[u8],
11401 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11402 let avail_len = __input.len();
11403 let mut payload_buf = [0; Self::ENCODED_LEN];
11404 let mut buf = if avail_len < Self::ENCODED_LEN {
11405 payload_buf[0..avail_len].copy_from_slice(__input);
11406 Bytes::new(&payload_buf)
11407 } else {
11408 Bytes::new(__input)
11409 };
11410 let mut __struct = Self::default();
11411 __struct.time_usec = buf.get_u64_le();
11412 for v in &mut __struct.rpm {
11413 let val = buf.get_i32_le();
11414 *v = val;
11415 }
11416 for v in &mut __struct.voltage {
11417 let val = buf.get_f32_le();
11418 *v = val;
11419 }
11420 for v in &mut __struct.current {
11421 let val = buf.get_f32_le();
11422 *v = val;
11423 }
11424 __struct.index = buf.get_u8();
11425 Ok(__struct)
11426 }
11427 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11428 let mut __tmp = BytesMut::new(bytes);
11429 #[allow(clippy::absurd_extreme_comparisons)]
11430 #[allow(unused_comparisons)]
11431 if __tmp.remaining() < Self::ENCODED_LEN {
11432 panic!(
11433 "buffer is too small (need {} bytes, but got {})",
11434 Self::ENCODED_LEN,
11435 __tmp.remaining(),
11436 )
11437 }
11438 __tmp.put_u64_le(self.time_usec);
11439 for val in &self.rpm {
11440 __tmp.put_i32_le(*val);
11441 }
11442 for val in &self.voltage {
11443 __tmp.put_f32_le(*val);
11444 }
11445 for val in &self.current {
11446 __tmp.put_f32_le(*val);
11447 }
11448 __tmp.put_u8(self.index);
11449 if matches!(version, MavlinkVersion::V2) {
11450 let len = __tmp.len();
11451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11452 } else {
11453 __tmp.len()
11454 }
11455 }
11456}
11457#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11458#[doc = ""]
11459#[doc = "ID: 230"]
11460#[derive(Debug, Clone, PartialEq)]
11461#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11463#[cfg_attr(feature = "ts", derive(TS))]
11464#[cfg_attr(feature = "ts", ts(export))]
11465pub struct ESTIMATOR_STATUS_DATA {
11466 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11467 pub time_usec: u64,
11468 #[doc = "Velocity innovation test ratio"]
11469 pub vel_ratio: f32,
11470 #[doc = "Horizontal position innovation test ratio"]
11471 pub pos_horiz_ratio: f32,
11472 #[doc = "Vertical position innovation test ratio"]
11473 pub pos_vert_ratio: f32,
11474 #[doc = "Magnetometer innovation test ratio"]
11475 pub mag_ratio: f32,
11476 #[doc = "Height above terrain innovation test ratio"]
11477 pub hagl_ratio: f32,
11478 #[doc = "True airspeed innovation test ratio"]
11479 pub tas_ratio: f32,
11480 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11481 pub pos_horiz_accuracy: f32,
11482 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11483 pub pos_vert_accuracy: f32,
11484 #[doc = "Bitmap indicating which EKF outputs are valid."]
11485 pub flags: EstimatorStatusFlags,
11486}
11487impl ESTIMATOR_STATUS_DATA {
11488 pub const ENCODED_LEN: usize = 42usize;
11489 pub const DEFAULT: Self = Self {
11490 time_usec: 0_u64,
11491 vel_ratio: 0.0_f32,
11492 pos_horiz_ratio: 0.0_f32,
11493 pos_vert_ratio: 0.0_f32,
11494 mag_ratio: 0.0_f32,
11495 hagl_ratio: 0.0_f32,
11496 tas_ratio: 0.0_f32,
11497 pos_horiz_accuracy: 0.0_f32,
11498 pos_vert_accuracy: 0.0_f32,
11499 flags: EstimatorStatusFlags::DEFAULT,
11500 };
11501 #[cfg(feature = "arbitrary")]
11502 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11503 use arbitrary::{Arbitrary, Unstructured};
11504 let mut buf = [0u8; 1024];
11505 rng.fill_bytes(&mut buf);
11506 let mut unstructured = Unstructured::new(&buf);
11507 Self::arbitrary(&mut unstructured).unwrap_or_default()
11508 }
11509}
11510impl Default for ESTIMATOR_STATUS_DATA {
11511 fn default() -> Self {
11512 Self::DEFAULT.clone()
11513 }
11514}
11515impl MessageData for ESTIMATOR_STATUS_DATA {
11516 type Message = MavMessage;
11517 const ID: u32 = 230u32;
11518 const NAME: &'static str = "ESTIMATOR_STATUS";
11519 const EXTRA_CRC: u8 = 163u8;
11520 const ENCODED_LEN: usize = 42usize;
11521 fn deser(
11522 _version: MavlinkVersion,
11523 __input: &[u8],
11524 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11525 let avail_len = __input.len();
11526 let mut payload_buf = [0; Self::ENCODED_LEN];
11527 let mut buf = if avail_len < Self::ENCODED_LEN {
11528 payload_buf[0..avail_len].copy_from_slice(__input);
11529 Bytes::new(&payload_buf)
11530 } else {
11531 Bytes::new(__input)
11532 };
11533 let mut __struct = Self::default();
11534 __struct.time_usec = buf.get_u64_le();
11535 __struct.vel_ratio = buf.get_f32_le();
11536 __struct.pos_horiz_ratio = buf.get_f32_le();
11537 __struct.pos_vert_ratio = buf.get_f32_le();
11538 __struct.mag_ratio = buf.get_f32_le();
11539 __struct.hagl_ratio = buf.get_f32_le();
11540 __struct.tas_ratio = buf.get_f32_le();
11541 __struct.pos_horiz_accuracy = buf.get_f32_le();
11542 __struct.pos_vert_accuracy = buf.get_f32_le();
11543 let tmp = buf.get_u16_le();
11544 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11545 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11546 flag_type: "EstimatorStatusFlags",
11547 value: tmp as u32,
11548 })?;
11549 Ok(__struct)
11550 }
11551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11552 let mut __tmp = BytesMut::new(bytes);
11553 #[allow(clippy::absurd_extreme_comparisons)]
11554 #[allow(unused_comparisons)]
11555 if __tmp.remaining() < Self::ENCODED_LEN {
11556 panic!(
11557 "buffer is too small (need {} bytes, but got {})",
11558 Self::ENCODED_LEN,
11559 __tmp.remaining(),
11560 )
11561 }
11562 __tmp.put_u64_le(self.time_usec);
11563 __tmp.put_f32_le(self.vel_ratio);
11564 __tmp.put_f32_le(self.pos_horiz_ratio);
11565 __tmp.put_f32_le(self.pos_vert_ratio);
11566 __tmp.put_f32_le(self.mag_ratio);
11567 __tmp.put_f32_le(self.hagl_ratio);
11568 __tmp.put_f32_le(self.tas_ratio);
11569 __tmp.put_f32_le(self.pos_horiz_accuracy);
11570 __tmp.put_f32_le(self.pos_vert_accuracy);
11571 __tmp.put_u16_le(self.flags.bits());
11572 if matches!(version, MavlinkVersion::V2) {
11573 let len = __tmp.len();
11574 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11575 } else {
11576 __tmp.len()
11577 }
11578 }
11579}
11580#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11581#[doc = ""]
11582#[doc = "ID: 410"]
11583#[derive(Debug, Clone, PartialEq)]
11584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11586#[cfg_attr(feature = "ts", derive(TS))]
11587#[cfg_attr(feature = "ts", ts(export))]
11588pub struct EVENT_DATA {
11589 #[doc = "Event ID (as defined in the component metadata)"]
11590 pub id: u32,
11591 #[doc = "Timestamp (time since system boot when the event happened)."]
11592 pub event_time_boot_ms: u32,
11593 #[doc = "Sequence number."]
11594 pub sequence: u16,
11595 #[doc = "Component ID"]
11596 pub destination_component: u8,
11597 #[doc = "System ID"]
11598 pub destination_system: u8,
11599 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11600 pub log_levels: u8,
11601 #[doc = "Arguments (depend on event ID)."]
11602 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11603 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11604 pub arguments: [u8; 40],
11605}
11606impl EVENT_DATA {
11607 pub const ENCODED_LEN: usize = 53usize;
11608 pub const DEFAULT: Self = Self {
11609 id: 0_u32,
11610 event_time_boot_ms: 0_u32,
11611 sequence: 0_u16,
11612 destination_component: 0_u8,
11613 destination_system: 0_u8,
11614 log_levels: 0_u8,
11615 arguments: [0_u8; 40usize],
11616 };
11617 #[cfg(feature = "arbitrary")]
11618 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11619 use arbitrary::{Arbitrary, Unstructured};
11620 let mut buf = [0u8; 1024];
11621 rng.fill_bytes(&mut buf);
11622 let mut unstructured = Unstructured::new(&buf);
11623 Self::arbitrary(&mut unstructured).unwrap_or_default()
11624 }
11625}
11626impl Default for EVENT_DATA {
11627 fn default() -> Self {
11628 Self::DEFAULT.clone()
11629 }
11630}
11631impl MessageData for EVENT_DATA {
11632 type Message = MavMessage;
11633 const ID: u32 = 410u32;
11634 const NAME: &'static str = "EVENT";
11635 const EXTRA_CRC: u8 = 160u8;
11636 const ENCODED_LEN: usize = 53usize;
11637 fn deser(
11638 _version: MavlinkVersion,
11639 __input: &[u8],
11640 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11641 let avail_len = __input.len();
11642 let mut payload_buf = [0; Self::ENCODED_LEN];
11643 let mut buf = if avail_len < Self::ENCODED_LEN {
11644 payload_buf[0..avail_len].copy_from_slice(__input);
11645 Bytes::new(&payload_buf)
11646 } else {
11647 Bytes::new(__input)
11648 };
11649 let mut __struct = Self::default();
11650 __struct.id = buf.get_u32_le();
11651 __struct.event_time_boot_ms = buf.get_u32_le();
11652 __struct.sequence = buf.get_u16_le();
11653 __struct.destination_component = buf.get_u8();
11654 __struct.destination_system = buf.get_u8();
11655 __struct.log_levels = buf.get_u8();
11656 for v in &mut __struct.arguments {
11657 let val = buf.get_u8();
11658 *v = val;
11659 }
11660 Ok(__struct)
11661 }
11662 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11663 let mut __tmp = BytesMut::new(bytes);
11664 #[allow(clippy::absurd_extreme_comparisons)]
11665 #[allow(unused_comparisons)]
11666 if __tmp.remaining() < Self::ENCODED_LEN {
11667 panic!(
11668 "buffer is too small (need {} bytes, but got {})",
11669 Self::ENCODED_LEN,
11670 __tmp.remaining(),
11671 )
11672 }
11673 __tmp.put_u32_le(self.id);
11674 __tmp.put_u32_le(self.event_time_boot_ms);
11675 __tmp.put_u16_le(self.sequence);
11676 __tmp.put_u8(self.destination_component);
11677 __tmp.put_u8(self.destination_system);
11678 __tmp.put_u8(self.log_levels);
11679 for val in &self.arguments {
11680 __tmp.put_u8(*val);
11681 }
11682 if matches!(version, MavlinkVersion::V2) {
11683 let len = __tmp.len();
11684 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11685 } else {
11686 __tmp.len()
11687 }
11688 }
11689}
11690#[doc = "Provides state for additional features."]
11691#[doc = ""]
11692#[doc = "ID: 245"]
11693#[derive(Debug, Clone, PartialEq)]
11694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11695#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11696#[cfg_attr(feature = "ts", derive(TS))]
11697#[cfg_attr(feature = "ts", ts(export))]
11698pub struct EXTENDED_SYS_STATE_DATA {
11699 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11700 pub vtol_state: MavVtolState,
11701 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11702 pub landed_state: MavLandedState,
11703}
11704impl EXTENDED_SYS_STATE_DATA {
11705 pub const ENCODED_LEN: usize = 2usize;
11706 pub const DEFAULT: Self = Self {
11707 vtol_state: MavVtolState::DEFAULT,
11708 landed_state: MavLandedState::DEFAULT,
11709 };
11710 #[cfg(feature = "arbitrary")]
11711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11712 use arbitrary::{Arbitrary, Unstructured};
11713 let mut buf = [0u8; 1024];
11714 rng.fill_bytes(&mut buf);
11715 let mut unstructured = Unstructured::new(&buf);
11716 Self::arbitrary(&mut unstructured).unwrap_or_default()
11717 }
11718}
11719impl Default for EXTENDED_SYS_STATE_DATA {
11720 fn default() -> Self {
11721 Self::DEFAULT.clone()
11722 }
11723}
11724impl MessageData for EXTENDED_SYS_STATE_DATA {
11725 type Message = MavMessage;
11726 const ID: u32 = 245u32;
11727 const NAME: &'static str = "EXTENDED_SYS_STATE";
11728 const EXTRA_CRC: u8 = 130u8;
11729 const ENCODED_LEN: usize = 2usize;
11730 fn deser(
11731 _version: MavlinkVersion,
11732 __input: &[u8],
11733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11734 let avail_len = __input.len();
11735 let mut payload_buf = [0; Self::ENCODED_LEN];
11736 let mut buf = if avail_len < Self::ENCODED_LEN {
11737 payload_buf[0..avail_len].copy_from_slice(__input);
11738 Bytes::new(&payload_buf)
11739 } else {
11740 Bytes::new(__input)
11741 };
11742 let mut __struct = Self::default();
11743 let tmp = buf.get_u8();
11744 __struct.vtol_state =
11745 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11746 enum_type: "MavVtolState",
11747 value: tmp as u32,
11748 })?;
11749 let tmp = buf.get_u8();
11750 __struct.landed_state =
11751 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11752 enum_type: "MavLandedState",
11753 value: tmp as u32,
11754 })?;
11755 Ok(__struct)
11756 }
11757 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11758 let mut __tmp = BytesMut::new(bytes);
11759 #[allow(clippy::absurd_extreme_comparisons)]
11760 #[allow(unused_comparisons)]
11761 if __tmp.remaining() < Self::ENCODED_LEN {
11762 panic!(
11763 "buffer is too small (need {} bytes, but got {})",
11764 Self::ENCODED_LEN,
11765 __tmp.remaining(),
11766 )
11767 }
11768 __tmp.put_u8(self.vtol_state as u8);
11769 __tmp.put_u8(self.landed_state as u8);
11770 if matches!(version, MavlinkVersion::V2) {
11771 let len = __tmp.len();
11772 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11773 } else {
11774 __tmp.len()
11775 }
11776 }
11777}
11778#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11779#[doc = ""]
11780#[doc = "ID: 162"]
11781#[derive(Debug, Clone, PartialEq)]
11782#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11783#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11784#[cfg_attr(feature = "ts", derive(TS))]
11785#[cfg_attr(feature = "ts", ts(export))]
11786pub struct FENCE_STATUS_DATA {
11787 #[doc = "Time (since boot) of last breach."]
11788 pub breach_time: u32,
11789 #[doc = "Number of fence breaches."]
11790 pub breach_count: u16,
11791 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11792 pub breach_status: u8,
11793 #[doc = "Last breach type."]
11794 pub breach_type: FenceBreach,
11795 #[doc = "Active action to prevent fence breach"]
11796 #[cfg_attr(feature = "serde", serde(default))]
11797 pub breach_mitigation: FenceMitigate,
11798}
11799impl FENCE_STATUS_DATA {
11800 pub const ENCODED_LEN: usize = 9usize;
11801 pub const DEFAULT: Self = Self {
11802 breach_time: 0_u32,
11803 breach_count: 0_u16,
11804 breach_status: 0_u8,
11805 breach_type: FenceBreach::DEFAULT,
11806 breach_mitigation: FenceMitigate::DEFAULT,
11807 };
11808 #[cfg(feature = "arbitrary")]
11809 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11810 use arbitrary::{Arbitrary, Unstructured};
11811 let mut buf = [0u8; 1024];
11812 rng.fill_bytes(&mut buf);
11813 let mut unstructured = Unstructured::new(&buf);
11814 Self::arbitrary(&mut unstructured).unwrap_or_default()
11815 }
11816}
11817impl Default for FENCE_STATUS_DATA {
11818 fn default() -> Self {
11819 Self::DEFAULT.clone()
11820 }
11821}
11822impl MessageData for FENCE_STATUS_DATA {
11823 type Message = MavMessage;
11824 const ID: u32 = 162u32;
11825 const NAME: &'static str = "FENCE_STATUS";
11826 const EXTRA_CRC: u8 = 189u8;
11827 const ENCODED_LEN: usize = 9usize;
11828 fn deser(
11829 _version: MavlinkVersion,
11830 __input: &[u8],
11831 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11832 let avail_len = __input.len();
11833 let mut payload_buf = [0; Self::ENCODED_LEN];
11834 let mut buf = if avail_len < Self::ENCODED_LEN {
11835 payload_buf[0..avail_len].copy_from_slice(__input);
11836 Bytes::new(&payload_buf)
11837 } else {
11838 Bytes::new(__input)
11839 };
11840 let mut __struct = Self::default();
11841 __struct.breach_time = buf.get_u32_le();
11842 __struct.breach_count = buf.get_u16_le();
11843 __struct.breach_status = buf.get_u8();
11844 let tmp = buf.get_u8();
11845 __struct.breach_type =
11846 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11847 enum_type: "FenceBreach",
11848 value: tmp as u32,
11849 })?;
11850 let tmp = buf.get_u8();
11851 __struct.breach_mitigation =
11852 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11853 enum_type: "FenceMitigate",
11854 value: tmp as u32,
11855 })?;
11856 Ok(__struct)
11857 }
11858 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11859 let mut __tmp = BytesMut::new(bytes);
11860 #[allow(clippy::absurd_extreme_comparisons)]
11861 #[allow(unused_comparisons)]
11862 if __tmp.remaining() < Self::ENCODED_LEN {
11863 panic!(
11864 "buffer is too small (need {} bytes, but got {})",
11865 Self::ENCODED_LEN,
11866 __tmp.remaining(),
11867 )
11868 }
11869 __tmp.put_u32_le(self.breach_time);
11870 __tmp.put_u16_le(self.breach_count);
11871 __tmp.put_u8(self.breach_status);
11872 __tmp.put_u8(self.breach_type as u8);
11873 if matches!(version, MavlinkVersion::V2) {
11874 __tmp.put_u8(self.breach_mitigation as u8);
11875 let len = __tmp.len();
11876 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11877 } else {
11878 __tmp.len()
11879 }
11880 }
11881}
11882#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11883#[doc = ""]
11884#[doc = "ID: 110"]
11885#[derive(Debug, Clone, PartialEq)]
11886#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11887#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11888#[cfg_attr(feature = "ts", derive(TS))]
11889#[cfg_attr(feature = "ts", ts(export))]
11890pub struct FILE_TRANSFER_PROTOCOL_DATA {
11891 #[doc = "Network ID (0 for broadcast)"]
11892 pub target_network: u8,
11893 #[doc = "System ID (0 for broadcast)"]
11894 pub target_system: u8,
11895 #[doc = "Component ID (0 for broadcast)"]
11896 pub target_component: u8,
11897 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11898 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11899 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11900 pub payload: [u8; 251],
11901}
11902impl FILE_TRANSFER_PROTOCOL_DATA {
11903 pub const ENCODED_LEN: usize = 254usize;
11904 pub const DEFAULT: Self = Self {
11905 target_network: 0_u8,
11906 target_system: 0_u8,
11907 target_component: 0_u8,
11908 payload: [0_u8; 251usize],
11909 };
11910 #[cfg(feature = "arbitrary")]
11911 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11912 use arbitrary::{Arbitrary, Unstructured};
11913 let mut buf = [0u8; 1024];
11914 rng.fill_bytes(&mut buf);
11915 let mut unstructured = Unstructured::new(&buf);
11916 Self::arbitrary(&mut unstructured).unwrap_or_default()
11917 }
11918}
11919impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11920 fn default() -> Self {
11921 Self::DEFAULT.clone()
11922 }
11923}
11924impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11925 type Message = MavMessage;
11926 const ID: u32 = 110u32;
11927 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11928 const EXTRA_CRC: u8 = 84u8;
11929 const ENCODED_LEN: usize = 254usize;
11930 fn deser(
11931 _version: MavlinkVersion,
11932 __input: &[u8],
11933 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11934 let avail_len = __input.len();
11935 let mut payload_buf = [0; Self::ENCODED_LEN];
11936 let mut buf = if avail_len < Self::ENCODED_LEN {
11937 payload_buf[0..avail_len].copy_from_slice(__input);
11938 Bytes::new(&payload_buf)
11939 } else {
11940 Bytes::new(__input)
11941 };
11942 let mut __struct = Self::default();
11943 __struct.target_network = buf.get_u8();
11944 __struct.target_system = buf.get_u8();
11945 __struct.target_component = buf.get_u8();
11946 for v in &mut __struct.payload {
11947 let val = buf.get_u8();
11948 *v = val;
11949 }
11950 Ok(__struct)
11951 }
11952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11953 let mut __tmp = BytesMut::new(bytes);
11954 #[allow(clippy::absurd_extreme_comparisons)]
11955 #[allow(unused_comparisons)]
11956 if __tmp.remaining() < Self::ENCODED_LEN {
11957 panic!(
11958 "buffer is too small (need {} bytes, but got {})",
11959 Self::ENCODED_LEN,
11960 __tmp.remaining(),
11961 )
11962 }
11963 __tmp.put_u8(self.target_network);
11964 __tmp.put_u8(self.target_system);
11965 __tmp.put_u8(self.target_component);
11966 for val in &self.payload {
11967 __tmp.put_u8(*val);
11968 }
11969 if matches!(version, MavlinkVersion::V2) {
11970 let len = __tmp.len();
11971 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11972 } else {
11973 __tmp.len()
11974 }
11975 }
11976}
11977#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11978#[doc = ""]
11979#[doc = "ID: 264"]
11980#[derive(Debug, Clone, PartialEq)]
11981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11983#[cfg_attr(feature = "ts", derive(TS))]
11984#[cfg_attr(feature = "ts", ts(export))]
11985pub struct FLIGHT_INFORMATION_DATA {
11986 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11987 pub arming_time_utc: u64,
11988 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11989 pub takeoff_time_utc: u64,
11990 #[doc = "Flight number. Note, field is misnamed UUID."]
11991 pub flight_uuid: u64,
11992 #[doc = "Timestamp (time since system boot)."]
11993 pub time_boot_ms: u32,
11994 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11995 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11996 pub landing_time: u32,
11997}
11998impl FLIGHT_INFORMATION_DATA {
11999 pub const ENCODED_LEN: usize = 32usize;
12000 pub const DEFAULT: Self = Self {
12001 arming_time_utc: 0_u64,
12002 takeoff_time_utc: 0_u64,
12003 flight_uuid: 0_u64,
12004 time_boot_ms: 0_u32,
12005 landing_time: 0_u32,
12006 };
12007 #[cfg(feature = "arbitrary")]
12008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12009 use arbitrary::{Arbitrary, Unstructured};
12010 let mut buf = [0u8; 1024];
12011 rng.fill_bytes(&mut buf);
12012 let mut unstructured = Unstructured::new(&buf);
12013 Self::arbitrary(&mut unstructured).unwrap_or_default()
12014 }
12015}
12016impl Default for FLIGHT_INFORMATION_DATA {
12017 fn default() -> Self {
12018 Self::DEFAULT.clone()
12019 }
12020}
12021impl MessageData for FLIGHT_INFORMATION_DATA {
12022 type Message = MavMessage;
12023 const ID: u32 = 264u32;
12024 const NAME: &'static str = "FLIGHT_INFORMATION";
12025 const EXTRA_CRC: u8 = 49u8;
12026 const ENCODED_LEN: usize = 32usize;
12027 fn deser(
12028 _version: MavlinkVersion,
12029 __input: &[u8],
12030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12031 let avail_len = __input.len();
12032 let mut payload_buf = [0; Self::ENCODED_LEN];
12033 let mut buf = if avail_len < Self::ENCODED_LEN {
12034 payload_buf[0..avail_len].copy_from_slice(__input);
12035 Bytes::new(&payload_buf)
12036 } else {
12037 Bytes::new(__input)
12038 };
12039 let mut __struct = Self::default();
12040 __struct.arming_time_utc = buf.get_u64_le();
12041 __struct.takeoff_time_utc = buf.get_u64_le();
12042 __struct.flight_uuid = buf.get_u64_le();
12043 __struct.time_boot_ms = buf.get_u32_le();
12044 __struct.landing_time = buf.get_u32_le();
12045 Ok(__struct)
12046 }
12047 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12048 let mut __tmp = BytesMut::new(bytes);
12049 #[allow(clippy::absurd_extreme_comparisons)]
12050 #[allow(unused_comparisons)]
12051 if __tmp.remaining() < Self::ENCODED_LEN {
12052 panic!(
12053 "buffer is too small (need {} bytes, but got {})",
12054 Self::ENCODED_LEN,
12055 __tmp.remaining(),
12056 )
12057 }
12058 __tmp.put_u64_le(self.arming_time_utc);
12059 __tmp.put_u64_le(self.takeoff_time_utc);
12060 __tmp.put_u64_le(self.flight_uuid);
12061 __tmp.put_u32_le(self.time_boot_ms);
12062 if matches!(version, MavlinkVersion::V2) {
12063 __tmp.put_u32_le(self.landing_time);
12064 let len = __tmp.len();
12065 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12066 } else {
12067 __tmp.len()
12068 }
12069 }
12070}
12071#[doc = "Current motion information from a designated system."]
12072#[doc = ""]
12073#[doc = "ID: 144"]
12074#[derive(Debug, Clone, PartialEq)]
12075#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12076#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12077#[cfg_attr(feature = "ts", derive(TS))]
12078#[cfg_attr(feature = "ts", ts(export))]
12079pub struct FOLLOW_TARGET_DATA {
12080 #[doc = "Timestamp (time since system boot)."]
12081 pub timestamp: u64,
12082 #[doc = "button states or switches of a tracker device"]
12083 pub custom_state: u64,
12084 #[doc = "Latitude (WGS84)"]
12085 pub lat: i32,
12086 #[doc = "Longitude (WGS84)"]
12087 pub lon: i32,
12088 #[doc = "Altitude (MSL)"]
12089 pub alt: f32,
12090 #[doc = "target velocity (0,0,0) for unknown"]
12091 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12092 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12093 pub vel: [f32; 3],
12094 #[doc = "linear target acceleration (0,0,0) for unknown"]
12095 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12096 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12097 pub acc: [f32; 3],
12098 #[doc = "(0 0 0 0 for unknown)"]
12099 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12100 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12101 pub attitude_q: [f32; 4],
12102 #[doc = "(0 0 0 for unknown)"]
12103 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12104 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12105 pub rates: [f32; 3],
12106 #[doc = "eph epv"]
12107 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12108 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12109 pub position_cov: [f32; 3],
12110 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12111 pub est_capabilities: u8,
12112}
12113impl FOLLOW_TARGET_DATA {
12114 pub const ENCODED_LEN: usize = 93usize;
12115 pub const DEFAULT: Self = Self {
12116 timestamp: 0_u64,
12117 custom_state: 0_u64,
12118 lat: 0_i32,
12119 lon: 0_i32,
12120 alt: 0.0_f32,
12121 vel: [0.0_f32; 3usize],
12122 acc: [0.0_f32; 3usize],
12123 attitude_q: [0.0_f32; 4usize],
12124 rates: [0.0_f32; 3usize],
12125 position_cov: [0.0_f32; 3usize],
12126 est_capabilities: 0_u8,
12127 };
12128 #[cfg(feature = "arbitrary")]
12129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12130 use arbitrary::{Arbitrary, Unstructured};
12131 let mut buf = [0u8; 1024];
12132 rng.fill_bytes(&mut buf);
12133 let mut unstructured = Unstructured::new(&buf);
12134 Self::arbitrary(&mut unstructured).unwrap_or_default()
12135 }
12136}
12137impl Default for FOLLOW_TARGET_DATA {
12138 fn default() -> Self {
12139 Self::DEFAULT.clone()
12140 }
12141}
12142impl MessageData for FOLLOW_TARGET_DATA {
12143 type Message = MavMessage;
12144 const ID: u32 = 144u32;
12145 const NAME: &'static str = "FOLLOW_TARGET";
12146 const EXTRA_CRC: u8 = 127u8;
12147 const ENCODED_LEN: usize = 93usize;
12148 fn deser(
12149 _version: MavlinkVersion,
12150 __input: &[u8],
12151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12152 let avail_len = __input.len();
12153 let mut payload_buf = [0; Self::ENCODED_LEN];
12154 let mut buf = if avail_len < Self::ENCODED_LEN {
12155 payload_buf[0..avail_len].copy_from_slice(__input);
12156 Bytes::new(&payload_buf)
12157 } else {
12158 Bytes::new(__input)
12159 };
12160 let mut __struct = Self::default();
12161 __struct.timestamp = buf.get_u64_le();
12162 __struct.custom_state = buf.get_u64_le();
12163 __struct.lat = buf.get_i32_le();
12164 __struct.lon = buf.get_i32_le();
12165 __struct.alt = buf.get_f32_le();
12166 for v in &mut __struct.vel {
12167 let val = buf.get_f32_le();
12168 *v = val;
12169 }
12170 for v in &mut __struct.acc {
12171 let val = buf.get_f32_le();
12172 *v = val;
12173 }
12174 for v in &mut __struct.attitude_q {
12175 let val = buf.get_f32_le();
12176 *v = val;
12177 }
12178 for v in &mut __struct.rates {
12179 let val = buf.get_f32_le();
12180 *v = val;
12181 }
12182 for v in &mut __struct.position_cov {
12183 let val = buf.get_f32_le();
12184 *v = val;
12185 }
12186 __struct.est_capabilities = buf.get_u8();
12187 Ok(__struct)
12188 }
12189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12190 let mut __tmp = BytesMut::new(bytes);
12191 #[allow(clippy::absurd_extreme_comparisons)]
12192 #[allow(unused_comparisons)]
12193 if __tmp.remaining() < Self::ENCODED_LEN {
12194 panic!(
12195 "buffer is too small (need {} bytes, but got {})",
12196 Self::ENCODED_LEN,
12197 __tmp.remaining(),
12198 )
12199 }
12200 __tmp.put_u64_le(self.timestamp);
12201 __tmp.put_u64_le(self.custom_state);
12202 __tmp.put_i32_le(self.lat);
12203 __tmp.put_i32_le(self.lon);
12204 __tmp.put_f32_le(self.alt);
12205 for val in &self.vel {
12206 __tmp.put_f32_le(*val);
12207 }
12208 for val in &self.acc {
12209 __tmp.put_f32_le(*val);
12210 }
12211 for val in &self.attitude_q {
12212 __tmp.put_f32_le(*val);
12213 }
12214 for val in &self.rates {
12215 __tmp.put_f32_le(*val);
12216 }
12217 for val in &self.position_cov {
12218 __tmp.put_f32_le(*val);
12219 }
12220 __tmp.put_u8(self.est_capabilities);
12221 if matches!(version, MavlinkVersion::V2) {
12222 let len = __tmp.len();
12223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12224 } else {
12225 __tmp.len()
12226 }
12227 }
12228}
12229#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12230#[doc = ""]
12231#[doc = "ID: 371"]
12232#[derive(Debug, Clone, PartialEq)]
12233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12235#[cfg_attr(feature = "ts", derive(TS))]
12236#[cfg_attr(feature = "ts", ts(export))]
12237pub struct FUEL_STATUS_DATA {
12238 #[doc = "Capacity when full. Must be provided."]
12239 pub maximum_fuel: f32,
12240 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12241 pub consumed_fuel: f32,
12242 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12243 pub remaining_fuel: f32,
12244 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12245 pub flow_rate: f32,
12246 #[doc = "Fuel temperature. NaN: field not provided."]
12247 pub temperature: f32,
12248 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12249 pub fuel_type: MavFuelType,
12250 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12251 pub id: u8,
12252 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12253 pub percent_remaining: u8,
12254}
12255impl FUEL_STATUS_DATA {
12256 pub const ENCODED_LEN: usize = 26usize;
12257 pub const DEFAULT: Self = Self {
12258 maximum_fuel: 0.0_f32,
12259 consumed_fuel: 0.0_f32,
12260 remaining_fuel: 0.0_f32,
12261 flow_rate: 0.0_f32,
12262 temperature: 0.0_f32,
12263 fuel_type: MavFuelType::DEFAULT,
12264 id: 0_u8,
12265 percent_remaining: 0_u8,
12266 };
12267 #[cfg(feature = "arbitrary")]
12268 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12269 use arbitrary::{Arbitrary, Unstructured};
12270 let mut buf = [0u8; 1024];
12271 rng.fill_bytes(&mut buf);
12272 let mut unstructured = Unstructured::new(&buf);
12273 Self::arbitrary(&mut unstructured).unwrap_or_default()
12274 }
12275}
12276impl Default for FUEL_STATUS_DATA {
12277 fn default() -> Self {
12278 Self::DEFAULT.clone()
12279 }
12280}
12281impl MessageData for FUEL_STATUS_DATA {
12282 type Message = MavMessage;
12283 const ID: u32 = 371u32;
12284 const NAME: &'static str = "FUEL_STATUS";
12285 const EXTRA_CRC: u8 = 10u8;
12286 const ENCODED_LEN: usize = 26usize;
12287 fn deser(
12288 _version: MavlinkVersion,
12289 __input: &[u8],
12290 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12291 let avail_len = __input.len();
12292 let mut payload_buf = [0; Self::ENCODED_LEN];
12293 let mut buf = if avail_len < Self::ENCODED_LEN {
12294 payload_buf[0..avail_len].copy_from_slice(__input);
12295 Bytes::new(&payload_buf)
12296 } else {
12297 Bytes::new(__input)
12298 };
12299 let mut __struct = Self::default();
12300 __struct.maximum_fuel = buf.get_f32_le();
12301 __struct.consumed_fuel = buf.get_f32_le();
12302 __struct.remaining_fuel = buf.get_f32_le();
12303 __struct.flow_rate = buf.get_f32_le();
12304 __struct.temperature = buf.get_f32_le();
12305 let tmp = buf.get_u32_le();
12306 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12307 ::mavlink_core::error::ParserError::InvalidEnum {
12308 enum_type: "MavFuelType",
12309 value: tmp as u32,
12310 },
12311 )?;
12312 __struct.id = buf.get_u8();
12313 __struct.percent_remaining = buf.get_u8();
12314 Ok(__struct)
12315 }
12316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12317 let mut __tmp = BytesMut::new(bytes);
12318 #[allow(clippy::absurd_extreme_comparisons)]
12319 #[allow(unused_comparisons)]
12320 if __tmp.remaining() < Self::ENCODED_LEN {
12321 panic!(
12322 "buffer is too small (need {} bytes, but got {})",
12323 Self::ENCODED_LEN,
12324 __tmp.remaining(),
12325 )
12326 }
12327 __tmp.put_f32_le(self.maximum_fuel);
12328 __tmp.put_f32_le(self.consumed_fuel);
12329 __tmp.put_f32_le(self.remaining_fuel);
12330 __tmp.put_f32_le(self.flow_rate);
12331 __tmp.put_f32_le(self.temperature);
12332 __tmp.put_u32_le(self.fuel_type as u32);
12333 __tmp.put_u8(self.id);
12334 __tmp.put_u8(self.percent_remaining);
12335 if matches!(version, MavlinkVersion::V2) {
12336 let len = __tmp.len();
12337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12338 } else {
12339 __tmp.len()
12340 }
12341 }
12342}
12343#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12344#[doc = ""]
12345#[doc = "ID: 373"]
12346#[derive(Debug, Clone, PartialEq)]
12347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12349#[cfg_attr(feature = "ts", derive(TS))]
12350#[cfg_attr(feature = "ts", ts(export))]
12351pub struct GENERATOR_STATUS_DATA {
12352 #[doc = "Status flags."]
12353 pub status: MavGeneratorStatusFlag,
12354 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12355 pub battery_current: f32,
12356 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12357 pub load_current: f32,
12358 #[doc = "The power being generated. NaN: field not provided"]
12359 pub power_generated: f32,
12360 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12361 pub bus_voltage: f32,
12362 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12363 pub bat_current_setpoint: f32,
12364 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12365 pub runtime: u32,
12366 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12367 pub time_until_maintenance: i32,
12368 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12369 pub generator_speed: u16,
12370 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12371 pub rectifier_temperature: i16,
12372 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12373 pub generator_temperature: i16,
12374}
12375impl GENERATOR_STATUS_DATA {
12376 pub const ENCODED_LEN: usize = 42usize;
12377 pub const DEFAULT: Self = Self {
12378 status: MavGeneratorStatusFlag::DEFAULT,
12379 battery_current: 0.0_f32,
12380 load_current: 0.0_f32,
12381 power_generated: 0.0_f32,
12382 bus_voltage: 0.0_f32,
12383 bat_current_setpoint: 0.0_f32,
12384 runtime: 0_u32,
12385 time_until_maintenance: 0_i32,
12386 generator_speed: 0_u16,
12387 rectifier_temperature: 0_i16,
12388 generator_temperature: 0_i16,
12389 };
12390 #[cfg(feature = "arbitrary")]
12391 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12392 use arbitrary::{Arbitrary, Unstructured};
12393 let mut buf = [0u8; 1024];
12394 rng.fill_bytes(&mut buf);
12395 let mut unstructured = Unstructured::new(&buf);
12396 Self::arbitrary(&mut unstructured).unwrap_or_default()
12397 }
12398}
12399impl Default for GENERATOR_STATUS_DATA {
12400 fn default() -> Self {
12401 Self::DEFAULT.clone()
12402 }
12403}
12404impl MessageData for GENERATOR_STATUS_DATA {
12405 type Message = MavMessage;
12406 const ID: u32 = 373u32;
12407 const NAME: &'static str = "GENERATOR_STATUS";
12408 const EXTRA_CRC: u8 = 117u8;
12409 const ENCODED_LEN: usize = 42usize;
12410 fn deser(
12411 _version: MavlinkVersion,
12412 __input: &[u8],
12413 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12414 let avail_len = __input.len();
12415 let mut payload_buf = [0; Self::ENCODED_LEN];
12416 let mut buf = if avail_len < Self::ENCODED_LEN {
12417 payload_buf[0..avail_len].copy_from_slice(__input);
12418 Bytes::new(&payload_buf)
12419 } else {
12420 Bytes::new(__input)
12421 };
12422 let mut __struct = Self::default();
12423 let tmp = buf.get_u64_le();
12424 __struct.status = MavGeneratorStatusFlag::from_bits(
12425 tmp & MavGeneratorStatusFlag::all().bits(),
12426 )
12427 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12428 flag_type: "MavGeneratorStatusFlag",
12429 value: tmp as u32,
12430 })?;
12431 __struct.battery_current = buf.get_f32_le();
12432 __struct.load_current = buf.get_f32_le();
12433 __struct.power_generated = buf.get_f32_le();
12434 __struct.bus_voltage = buf.get_f32_le();
12435 __struct.bat_current_setpoint = buf.get_f32_le();
12436 __struct.runtime = buf.get_u32_le();
12437 __struct.time_until_maintenance = buf.get_i32_le();
12438 __struct.generator_speed = buf.get_u16_le();
12439 __struct.rectifier_temperature = buf.get_i16_le();
12440 __struct.generator_temperature = buf.get_i16_le();
12441 Ok(__struct)
12442 }
12443 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12444 let mut __tmp = BytesMut::new(bytes);
12445 #[allow(clippy::absurd_extreme_comparisons)]
12446 #[allow(unused_comparisons)]
12447 if __tmp.remaining() < Self::ENCODED_LEN {
12448 panic!(
12449 "buffer is too small (need {} bytes, but got {})",
12450 Self::ENCODED_LEN,
12451 __tmp.remaining(),
12452 )
12453 }
12454 __tmp.put_u64_le(self.status.bits());
12455 __tmp.put_f32_le(self.battery_current);
12456 __tmp.put_f32_le(self.load_current);
12457 __tmp.put_f32_le(self.power_generated);
12458 __tmp.put_f32_le(self.bus_voltage);
12459 __tmp.put_f32_le(self.bat_current_setpoint);
12460 __tmp.put_u32_le(self.runtime);
12461 __tmp.put_i32_le(self.time_until_maintenance);
12462 __tmp.put_u16_le(self.generator_speed);
12463 __tmp.put_i16_le(self.rectifier_temperature);
12464 __tmp.put_i16_le(self.generator_temperature);
12465 if matches!(version, MavlinkVersion::V2) {
12466 let len = __tmp.len();
12467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12468 } else {
12469 __tmp.len()
12470 }
12471 }
12472}
12473#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12474#[doc = ""]
12475#[doc = "ID: 285"]
12476#[derive(Debug, Clone, PartialEq)]
12477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12479#[cfg_attr(feature = "ts", derive(TS))]
12480#[cfg_attr(feature = "ts", ts(export))]
12481pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12482 #[doc = "Timestamp (time since system boot)."]
12483 pub time_boot_ms: u32,
12484 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12486 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12487 pub q: [f32; 4],
12488 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12489 pub angular_velocity_x: f32,
12490 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12491 pub angular_velocity_y: f32,
12492 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12493 pub angular_velocity_z: f32,
12494 #[doc = "Failure flags (0 for no failure)"]
12495 pub failure_flags: GimbalDeviceErrorFlags,
12496 #[doc = "Current gimbal flags set."]
12497 pub flags: GimbalDeviceFlags,
12498 #[doc = "System ID"]
12499 pub target_system: u8,
12500 #[doc = "Component ID"]
12501 pub target_component: u8,
12502 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12503 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12504 pub delta_yaw: f32,
12505 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12506 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12507 pub delta_yaw_velocity: f32,
12508 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12509 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12510 pub gimbal_device_id: u8,
12511}
12512impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12513 pub const ENCODED_LEN: usize = 49usize;
12514 pub const DEFAULT: Self = Self {
12515 time_boot_ms: 0_u32,
12516 q: [0.0_f32; 4usize],
12517 angular_velocity_x: 0.0_f32,
12518 angular_velocity_y: 0.0_f32,
12519 angular_velocity_z: 0.0_f32,
12520 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12521 flags: GimbalDeviceFlags::DEFAULT,
12522 target_system: 0_u8,
12523 target_component: 0_u8,
12524 delta_yaw: 0.0_f32,
12525 delta_yaw_velocity: 0.0_f32,
12526 gimbal_device_id: 0_u8,
12527 };
12528 #[cfg(feature = "arbitrary")]
12529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12530 use arbitrary::{Arbitrary, Unstructured};
12531 let mut buf = [0u8; 1024];
12532 rng.fill_bytes(&mut buf);
12533 let mut unstructured = Unstructured::new(&buf);
12534 Self::arbitrary(&mut unstructured).unwrap_or_default()
12535 }
12536}
12537impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12538 fn default() -> Self {
12539 Self::DEFAULT.clone()
12540 }
12541}
12542impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12543 type Message = MavMessage;
12544 const ID: u32 = 285u32;
12545 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12546 const EXTRA_CRC: u8 = 137u8;
12547 const ENCODED_LEN: usize = 49usize;
12548 fn deser(
12549 _version: MavlinkVersion,
12550 __input: &[u8],
12551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12552 let avail_len = __input.len();
12553 let mut payload_buf = [0; Self::ENCODED_LEN];
12554 let mut buf = if avail_len < Self::ENCODED_LEN {
12555 payload_buf[0..avail_len].copy_from_slice(__input);
12556 Bytes::new(&payload_buf)
12557 } else {
12558 Bytes::new(__input)
12559 };
12560 let mut __struct = Self::default();
12561 __struct.time_boot_ms = buf.get_u32_le();
12562 for v in &mut __struct.q {
12563 let val = buf.get_f32_le();
12564 *v = val;
12565 }
12566 __struct.angular_velocity_x = buf.get_f32_le();
12567 __struct.angular_velocity_y = buf.get_f32_le();
12568 __struct.angular_velocity_z = buf.get_f32_le();
12569 let tmp = buf.get_u32_le();
12570 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12571 tmp & GimbalDeviceErrorFlags::all().bits(),
12572 )
12573 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12574 flag_type: "GimbalDeviceErrorFlags",
12575 value: tmp as u32,
12576 })?;
12577 let tmp = buf.get_u16_le();
12578 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12579 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12580 flag_type: "GimbalDeviceFlags",
12581 value: tmp as u32,
12582 })?;
12583 __struct.target_system = buf.get_u8();
12584 __struct.target_component = buf.get_u8();
12585 __struct.delta_yaw = buf.get_f32_le();
12586 __struct.delta_yaw_velocity = buf.get_f32_le();
12587 __struct.gimbal_device_id = buf.get_u8();
12588 Ok(__struct)
12589 }
12590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12591 let mut __tmp = BytesMut::new(bytes);
12592 #[allow(clippy::absurd_extreme_comparisons)]
12593 #[allow(unused_comparisons)]
12594 if __tmp.remaining() < Self::ENCODED_LEN {
12595 panic!(
12596 "buffer is too small (need {} bytes, but got {})",
12597 Self::ENCODED_LEN,
12598 __tmp.remaining(),
12599 )
12600 }
12601 __tmp.put_u32_le(self.time_boot_ms);
12602 for val in &self.q {
12603 __tmp.put_f32_le(*val);
12604 }
12605 __tmp.put_f32_le(self.angular_velocity_x);
12606 __tmp.put_f32_le(self.angular_velocity_y);
12607 __tmp.put_f32_le(self.angular_velocity_z);
12608 __tmp.put_u32_le(self.failure_flags.bits());
12609 __tmp.put_u16_le(self.flags.bits());
12610 __tmp.put_u8(self.target_system);
12611 __tmp.put_u8(self.target_component);
12612 if matches!(version, MavlinkVersion::V2) {
12613 __tmp.put_f32_le(self.delta_yaw);
12614 __tmp.put_f32_le(self.delta_yaw_velocity);
12615 __tmp.put_u8(self.gimbal_device_id);
12616 let len = __tmp.len();
12617 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12618 } else {
12619 __tmp.len()
12620 }
12621 }
12622}
12623#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12624#[doc = ""]
12625#[doc = "ID: 283"]
12626#[derive(Debug, Clone, PartialEq)]
12627#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12629#[cfg_attr(feature = "ts", derive(TS))]
12630#[cfg_attr(feature = "ts", ts(export))]
12631pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12632 #[doc = "UID of gimbal hardware (0 if unknown)."]
12633 pub uid: u64,
12634 #[doc = "Timestamp (time since system boot)."]
12635 pub time_boot_ms: u32,
12636 #[doc = "0xff)."]
12637 pub firmware_version: u32,
12638 #[doc = "0xff)."]
12639 pub hardware_version: u32,
12640 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12641 pub roll_min: f32,
12642 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12643 pub roll_max: f32,
12644 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12645 pub pitch_min: f32,
12646 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12647 pub pitch_max: f32,
12648 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12649 pub yaw_min: f32,
12650 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12651 pub yaw_max: f32,
12652 #[doc = "Bitmap of gimbal capability flags."]
12653 pub cap_flags: GimbalDeviceCapFlags,
12654 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12655 pub custom_cap_flags: u16,
12656 #[doc = "Name of the gimbal vendor."]
12657 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12658 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12659 pub vendor_name: [u8; 32],
12660 #[doc = "Name of the gimbal model."]
12661 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12662 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12663 pub model_name: [u8; 32],
12664 #[doc = "Custom name of the gimbal given to it by the user."]
12665 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12666 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12667 pub custom_name: [u8; 32],
12668 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12669 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12670 pub gimbal_device_id: u8,
12671}
12672impl GIMBAL_DEVICE_INFORMATION_DATA {
12673 pub const ENCODED_LEN: usize = 145usize;
12674 pub const DEFAULT: Self = Self {
12675 uid: 0_u64,
12676 time_boot_ms: 0_u32,
12677 firmware_version: 0_u32,
12678 hardware_version: 0_u32,
12679 roll_min: 0.0_f32,
12680 roll_max: 0.0_f32,
12681 pitch_min: 0.0_f32,
12682 pitch_max: 0.0_f32,
12683 yaw_min: 0.0_f32,
12684 yaw_max: 0.0_f32,
12685 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12686 custom_cap_flags: 0_u16,
12687 vendor_name: [0_u8; 32usize],
12688 model_name: [0_u8; 32usize],
12689 custom_name: [0_u8; 32usize],
12690 gimbal_device_id: 0_u8,
12691 };
12692 #[cfg(feature = "arbitrary")]
12693 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12694 use arbitrary::{Arbitrary, Unstructured};
12695 let mut buf = [0u8; 1024];
12696 rng.fill_bytes(&mut buf);
12697 let mut unstructured = Unstructured::new(&buf);
12698 Self::arbitrary(&mut unstructured).unwrap_or_default()
12699 }
12700}
12701impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12702 fn default() -> Self {
12703 Self::DEFAULT.clone()
12704 }
12705}
12706impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12707 type Message = MavMessage;
12708 const ID: u32 = 283u32;
12709 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12710 const EXTRA_CRC: u8 = 74u8;
12711 const ENCODED_LEN: usize = 145usize;
12712 fn deser(
12713 _version: MavlinkVersion,
12714 __input: &[u8],
12715 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12716 let avail_len = __input.len();
12717 let mut payload_buf = [0; Self::ENCODED_LEN];
12718 let mut buf = if avail_len < Self::ENCODED_LEN {
12719 payload_buf[0..avail_len].copy_from_slice(__input);
12720 Bytes::new(&payload_buf)
12721 } else {
12722 Bytes::new(__input)
12723 };
12724 let mut __struct = Self::default();
12725 __struct.uid = buf.get_u64_le();
12726 __struct.time_boot_ms = buf.get_u32_le();
12727 __struct.firmware_version = buf.get_u32_le();
12728 __struct.hardware_version = buf.get_u32_le();
12729 __struct.roll_min = buf.get_f32_le();
12730 __struct.roll_max = buf.get_f32_le();
12731 __struct.pitch_min = buf.get_f32_le();
12732 __struct.pitch_max = buf.get_f32_le();
12733 __struct.yaw_min = buf.get_f32_le();
12734 __struct.yaw_max = buf.get_f32_le();
12735 let tmp = buf.get_u16_le();
12736 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12737 tmp & GimbalDeviceCapFlags::all().bits(),
12738 )
12739 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12740 flag_type: "GimbalDeviceCapFlags",
12741 value: tmp as u32,
12742 })?;
12743 __struct.custom_cap_flags = buf.get_u16_le();
12744 for v in &mut __struct.vendor_name {
12745 let val = buf.get_u8();
12746 *v = val;
12747 }
12748 for v in &mut __struct.model_name {
12749 let val = buf.get_u8();
12750 *v = val;
12751 }
12752 for v in &mut __struct.custom_name {
12753 let val = buf.get_u8();
12754 *v = val;
12755 }
12756 __struct.gimbal_device_id = buf.get_u8();
12757 Ok(__struct)
12758 }
12759 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12760 let mut __tmp = BytesMut::new(bytes);
12761 #[allow(clippy::absurd_extreme_comparisons)]
12762 #[allow(unused_comparisons)]
12763 if __tmp.remaining() < Self::ENCODED_LEN {
12764 panic!(
12765 "buffer is too small (need {} bytes, but got {})",
12766 Self::ENCODED_LEN,
12767 __tmp.remaining(),
12768 )
12769 }
12770 __tmp.put_u64_le(self.uid);
12771 __tmp.put_u32_le(self.time_boot_ms);
12772 __tmp.put_u32_le(self.firmware_version);
12773 __tmp.put_u32_le(self.hardware_version);
12774 __tmp.put_f32_le(self.roll_min);
12775 __tmp.put_f32_le(self.roll_max);
12776 __tmp.put_f32_le(self.pitch_min);
12777 __tmp.put_f32_le(self.pitch_max);
12778 __tmp.put_f32_le(self.yaw_min);
12779 __tmp.put_f32_le(self.yaw_max);
12780 __tmp.put_u16_le(self.cap_flags.bits());
12781 __tmp.put_u16_le(self.custom_cap_flags);
12782 for val in &self.vendor_name {
12783 __tmp.put_u8(*val);
12784 }
12785 for val in &self.model_name {
12786 __tmp.put_u8(*val);
12787 }
12788 for val in &self.custom_name {
12789 __tmp.put_u8(*val);
12790 }
12791 if matches!(version, MavlinkVersion::V2) {
12792 __tmp.put_u8(self.gimbal_device_id);
12793 let len = __tmp.len();
12794 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12795 } else {
12796 __tmp.len()
12797 }
12798 }
12799}
12800#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12801#[doc = ""]
12802#[doc = "ID: 284"]
12803#[derive(Debug, Clone, PartialEq)]
12804#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12805#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12806#[cfg_attr(feature = "ts", derive(TS))]
12807#[cfg_attr(feature = "ts", ts(export))]
12808pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12809 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12810 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12811 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12812 pub q: [f32; 4],
12813 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12814 pub angular_velocity_x: f32,
12815 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12816 pub angular_velocity_y: f32,
12817 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12818 pub angular_velocity_z: f32,
12819 #[doc = "Low level gimbal flags."]
12820 pub flags: GimbalDeviceFlags,
12821 #[doc = "System ID"]
12822 pub target_system: u8,
12823 #[doc = "Component ID"]
12824 pub target_component: u8,
12825}
12826impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12827 pub const ENCODED_LEN: usize = 32usize;
12828 pub const DEFAULT: Self = Self {
12829 q: [0.0_f32; 4usize],
12830 angular_velocity_x: 0.0_f32,
12831 angular_velocity_y: 0.0_f32,
12832 angular_velocity_z: 0.0_f32,
12833 flags: GimbalDeviceFlags::DEFAULT,
12834 target_system: 0_u8,
12835 target_component: 0_u8,
12836 };
12837 #[cfg(feature = "arbitrary")]
12838 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12839 use arbitrary::{Arbitrary, Unstructured};
12840 let mut buf = [0u8; 1024];
12841 rng.fill_bytes(&mut buf);
12842 let mut unstructured = Unstructured::new(&buf);
12843 Self::arbitrary(&mut unstructured).unwrap_or_default()
12844 }
12845}
12846impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12847 fn default() -> Self {
12848 Self::DEFAULT.clone()
12849 }
12850}
12851impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12852 type Message = MavMessage;
12853 const ID: u32 = 284u32;
12854 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12855 const EXTRA_CRC: u8 = 99u8;
12856 const ENCODED_LEN: usize = 32usize;
12857 fn deser(
12858 _version: MavlinkVersion,
12859 __input: &[u8],
12860 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12861 let avail_len = __input.len();
12862 let mut payload_buf = [0; Self::ENCODED_LEN];
12863 let mut buf = if avail_len < Self::ENCODED_LEN {
12864 payload_buf[0..avail_len].copy_from_slice(__input);
12865 Bytes::new(&payload_buf)
12866 } else {
12867 Bytes::new(__input)
12868 };
12869 let mut __struct = Self::default();
12870 for v in &mut __struct.q {
12871 let val = buf.get_f32_le();
12872 *v = val;
12873 }
12874 __struct.angular_velocity_x = buf.get_f32_le();
12875 __struct.angular_velocity_y = buf.get_f32_le();
12876 __struct.angular_velocity_z = buf.get_f32_le();
12877 let tmp = buf.get_u16_le();
12878 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12879 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12880 flag_type: "GimbalDeviceFlags",
12881 value: tmp as u32,
12882 })?;
12883 __struct.target_system = buf.get_u8();
12884 __struct.target_component = buf.get_u8();
12885 Ok(__struct)
12886 }
12887 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12888 let mut __tmp = BytesMut::new(bytes);
12889 #[allow(clippy::absurd_extreme_comparisons)]
12890 #[allow(unused_comparisons)]
12891 if __tmp.remaining() < Self::ENCODED_LEN {
12892 panic!(
12893 "buffer is too small (need {} bytes, but got {})",
12894 Self::ENCODED_LEN,
12895 __tmp.remaining(),
12896 )
12897 }
12898 for val in &self.q {
12899 __tmp.put_f32_le(*val);
12900 }
12901 __tmp.put_f32_le(self.angular_velocity_x);
12902 __tmp.put_f32_le(self.angular_velocity_y);
12903 __tmp.put_f32_le(self.angular_velocity_z);
12904 __tmp.put_u16_le(self.flags.bits());
12905 __tmp.put_u8(self.target_system);
12906 __tmp.put_u8(self.target_component);
12907 if matches!(version, MavlinkVersion::V2) {
12908 let len = __tmp.len();
12909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12910 } else {
12911 __tmp.len()
12912 }
12913 }
12914}
12915#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12916#[doc = ""]
12917#[doc = "ID: 280"]
12918#[derive(Debug, Clone, PartialEq)]
12919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12921#[cfg_attr(feature = "ts", derive(TS))]
12922#[cfg_attr(feature = "ts", ts(export))]
12923pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12924 #[doc = "Timestamp (time since system boot)."]
12925 pub time_boot_ms: u32,
12926 #[doc = "Bitmap of gimbal capability flags."]
12927 pub cap_flags: GimbalManagerCapFlags,
12928 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12929 pub roll_min: f32,
12930 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12931 pub roll_max: f32,
12932 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12933 pub pitch_min: f32,
12934 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12935 pub pitch_max: f32,
12936 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12937 pub yaw_min: f32,
12938 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12939 pub yaw_max: f32,
12940 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12941 pub gimbal_device_id: u8,
12942}
12943impl GIMBAL_MANAGER_INFORMATION_DATA {
12944 pub const ENCODED_LEN: usize = 33usize;
12945 pub const DEFAULT: Self = Self {
12946 time_boot_ms: 0_u32,
12947 cap_flags: GimbalManagerCapFlags::DEFAULT,
12948 roll_min: 0.0_f32,
12949 roll_max: 0.0_f32,
12950 pitch_min: 0.0_f32,
12951 pitch_max: 0.0_f32,
12952 yaw_min: 0.0_f32,
12953 yaw_max: 0.0_f32,
12954 gimbal_device_id: 0_u8,
12955 };
12956 #[cfg(feature = "arbitrary")]
12957 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12958 use arbitrary::{Arbitrary, Unstructured};
12959 let mut buf = [0u8; 1024];
12960 rng.fill_bytes(&mut buf);
12961 let mut unstructured = Unstructured::new(&buf);
12962 Self::arbitrary(&mut unstructured).unwrap_or_default()
12963 }
12964}
12965impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12966 fn default() -> Self {
12967 Self::DEFAULT.clone()
12968 }
12969}
12970impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12971 type Message = MavMessage;
12972 const ID: u32 = 280u32;
12973 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12974 const EXTRA_CRC: u8 = 70u8;
12975 const ENCODED_LEN: usize = 33usize;
12976 fn deser(
12977 _version: MavlinkVersion,
12978 __input: &[u8],
12979 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12980 let avail_len = __input.len();
12981 let mut payload_buf = [0; Self::ENCODED_LEN];
12982 let mut buf = if avail_len < Self::ENCODED_LEN {
12983 payload_buf[0..avail_len].copy_from_slice(__input);
12984 Bytes::new(&payload_buf)
12985 } else {
12986 Bytes::new(__input)
12987 };
12988 let mut __struct = Self::default();
12989 __struct.time_boot_ms = buf.get_u32_le();
12990 let tmp = buf.get_u32_le();
12991 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12992 tmp & GimbalManagerCapFlags::all().bits(),
12993 )
12994 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12995 flag_type: "GimbalManagerCapFlags",
12996 value: tmp as u32,
12997 })?;
12998 __struct.roll_min = buf.get_f32_le();
12999 __struct.roll_max = buf.get_f32_le();
13000 __struct.pitch_min = buf.get_f32_le();
13001 __struct.pitch_max = buf.get_f32_le();
13002 __struct.yaw_min = buf.get_f32_le();
13003 __struct.yaw_max = buf.get_f32_le();
13004 __struct.gimbal_device_id = buf.get_u8();
13005 Ok(__struct)
13006 }
13007 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13008 let mut __tmp = BytesMut::new(bytes);
13009 #[allow(clippy::absurd_extreme_comparisons)]
13010 #[allow(unused_comparisons)]
13011 if __tmp.remaining() < Self::ENCODED_LEN {
13012 panic!(
13013 "buffer is too small (need {} bytes, but got {})",
13014 Self::ENCODED_LEN,
13015 __tmp.remaining(),
13016 )
13017 }
13018 __tmp.put_u32_le(self.time_boot_ms);
13019 __tmp.put_u32_le(self.cap_flags.bits());
13020 __tmp.put_f32_le(self.roll_min);
13021 __tmp.put_f32_le(self.roll_max);
13022 __tmp.put_f32_le(self.pitch_min);
13023 __tmp.put_f32_le(self.pitch_max);
13024 __tmp.put_f32_le(self.yaw_min);
13025 __tmp.put_f32_le(self.yaw_max);
13026 __tmp.put_u8(self.gimbal_device_id);
13027 if matches!(version, MavlinkVersion::V2) {
13028 let len = __tmp.len();
13029 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13030 } else {
13031 __tmp.len()
13032 }
13033 }
13034}
13035#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13036#[doc = ""]
13037#[doc = "ID: 282"]
13038#[derive(Debug, Clone, PartialEq)]
13039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13040#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13041#[cfg_attr(feature = "ts", derive(TS))]
13042#[cfg_attr(feature = "ts", ts(export))]
13043pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13044 #[doc = "High level gimbal manager flags to use."]
13045 pub flags: GimbalManagerFlags,
13046 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13048 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13049 pub q: [f32; 4],
13050 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13051 pub angular_velocity_x: f32,
13052 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13053 pub angular_velocity_y: f32,
13054 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13055 pub angular_velocity_z: f32,
13056 #[doc = "System ID"]
13057 pub target_system: u8,
13058 #[doc = "Component ID"]
13059 pub target_component: u8,
13060 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13061 pub gimbal_device_id: u8,
13062}
13063impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13064 pub const ENCODED_LEN: usize = 35usize;
13065 pub const DEFAULT: Self = Self {
13066 flags: GimbalManagerFlags::DEFAULT,
13067 q: [0.0_f32; 4usize],
13068 angular_velocity_x: 0.0_f32,
13069 angular_velocity_y: 0.0_f32,
13070 angular_velocity_z: 0.0_f32,
13071 target_system: 0_u8,
13072 target_component: 0_u8,
13073 gimbal_device_id: 0_u8,
13074 };
13075 #[cfg(feature = "arbitrary")]
13076 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13077 use arbitrary::{Arbitrary, Unstructured};
13078 let mut buf = [0u8; 1024];
13079 rng.fill_bytes(&mut buf);
13080 let mut unstructured = Unstructured::new(&buf);
13081 Self::arbitrary(&mut unstructured).unwrap_or_default()
13082 }
13083}
13084impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13085 fn default() -> Self {
13086 Self::DEFAULT.clone()
13087 }
13088}
13089impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13090 type Message = MavMessage;
13091 const ID: u32 = 282u32;
13092 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13093 const EXTRA_CRC: u8 = 123u8;
13094 const ENCODED_LEN: usize = 35usize;
13095 fn deser(
13096 _version: MavlinkVersion,
13097 __input: &[u8],
13098 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13099 let avail_len = __input.len();
13100 let mut payload_buf = [0; Self::ENCODED_LEN];
13101 let mut buf = if avail_len < Self::ENCODED_LEN {
13102 payload_buf[0..avail_len].copy_from_slice(__input);
13103 Bytes::new(&payload_buf)
13104 } else {
13105 Bytes::new(__input)
13106 };
13107 let mut __struct = Self::default();
13108 let tmp = buf.get_u32_le();
13109 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13110 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13111 flag_type: "GimbalManagerFlags",
13112 value: tmp as u32,
13113 })?;
13114 for v in &mut __struct.q {
13115 let val = buf.get_f32_le();
13116 *v = val;
13117 }
13118 __struct.angular_velocity_x = buf.get_f32_le();
13119 __struct.angular_velocity_y = buf.get_f32_le();
13120 __struct.angular_velocity_z = buf.get_f32_le();
13121 __struct.target_system = buf.get_u8();
13122 __struct.target_component = buf.get_u8();
13123 __struct.gimbal_device_id = buf.get_u8();
13124 Ok(__struct)
13125 }
13126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13127 let mut __tmp = BytesMut::new(bytes);
13128 #[allow(clippy::absurd_extreme_comparisons)]
13129 #[allow(unused_comparisons)]
13130 if __tmp.remaining() < Self::ENCODED_LEN {
13131 panic!(
13132 "buffer is too small (need {} bytes, but got {})",
13133 Self::ENCODED_LEN,
13134 __tmp.remaining(),
13135 )
13136 }
13137 __tmp.put_u32_le(self.flags.bits());
13138 for val in &self.q {
13139 __tmp.put_f32_le(*val);
13140 }
13141 __tmp.put_f32_le(self.angular_velocity_x);
13142 __tmp.put_f32_le(self.angular_velocity_y);
13143 __tmp.put_f32_le(self.angular_velocity_z);
13144 __tmp.put_u8(self.target_system);
13145 __tmp.put_u8(self.target_component);
13146 __tmp.put_u8(self.gimbal_device_id);
13147 if matches!(version, MavlinkVersion::V2) {
13148 let len = __tmp.len();
13149 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13150 } else {
13151 __tmp.len()
13152 }
13153 }
13154}
13155#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13156#[doc = ""]
13157#[doc = "ID: 288"]
13158#[derive(Debug, Clone, PartialEq)]
13159#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13160#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13161#[cfg_attr(feature = "ts", derive(TS))]
13162#[cfg_attr(feature = "ts", ts(export))]
13163pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13164 #[doc = "High level gimbal manager flags."]
13165 pub flags: GimbalManagerFlags,
13166 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13167 pub pitch: f32,
13168 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13169 pub yaw: f32,
13170 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13171 pub pitch_rate: f32,
13172 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13173 pub yaw_rate: f32,
13174 #[doc = "System ID"]
13175 pub target_system: u8,
13176 #[doc = "Component ID"]
13177 pub target_component: u8,
13178 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13179 pub gimbal_device_id: u8,
13180}
13181impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13182 pub const ENCODED_LEN: usize = 23usize;
13183 pub const DEFAULT: Self = Self {
13184 flags: GimbalManagerFlags::DEFAULT,
13185 pitch: 0.0_f32,
13186 yaw: 0.0_f32,
13187 pitch_rate: 0.0_f32,
13188 yaw_rate: 0.0_f32,
13189 target_system: 0_u8,
13190 target_component: 0_u8,
13191 gimbal_device_id: 0_u8,
13192 };
13193 #[cfg(feature = "arbitrary")]
13194 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13195 use arbitrary::{Arbitrary, Unstructured};
13196 let mut buf = [0u8; 1024];
13197 rng.fill_bytes(&mut buf);
13198 let mut unstructured = Unstructured::new(&buf);
13199 Self::arbitrary(&mut unstructured).unwrap_or_default()
13200 }
13201}
13202impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13203 fn default() -> Self {
13204 Self::DEFAULT.clone()
13205 }
13206}
13207impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13208 type Message = MavMessage;
13209 const ID: u32 = 288u32;
13210 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13211 const EXTRA_CRC: u8 = 20u8;
13212 const ENCODED_LEN: usize = 23usize;
13213 fn deser(
13214 _version: MavlinkVersion,
13215 __input: &[u8],
13216 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13217 let avail_len = __input.len();
13218 let mut payload_buf = [0; Self::ENCODED_LEN];
13219 let mut buf = if avail_len < Self::ENCODED_LEN {
13220 payload_buf[0..avail_len].copy_from_slice(__input);
13221 Bytes::new(&payload_buf)
13222 } else {
13223 Bytes::new(__input)
13224 };
13225 let mut __struct = Self::default();
13226 let tmp = buf.get_u32_le();
13227 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13228 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13229 flag_type: "GimbalManagerFlags",
13230 value: tmp as u32,
13231 })?;
13232 __struct.pitch = buf.get_f32_le();
13233 __struct.yaw = buf.get_f32_le();
13234 __struct.pitch_rate = buf.get_f32_le();
13235 __struct.yaw_rate = buf.get_f32_le();
13236 __struct.target_system = buf.get_u8();
13237 __struct.target_component = buf.get_u8();
13238 __struct.gimbal_device_id = buf.get_u8();
13239 Ok(__struct)
13240 }
13241 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13242 let mut __tmp = BytesMut::new(bytes);
13243 #[allow(clippy::absurd_extreme_comparisons)]
13244 #[allow(unused_comparisons)]
13245 if __tmp.remaining() < Self::ENCODED_LEN {
13246 panic!(
13247 "buffer is too small (need {} bytes, but got {})",
13248 Self::ENCODED_LEN,
13249 __tmp.remaining(),
13250 )
13251 }
13252 __tmp.put_u32_le(self.flags.bits());
13253 __tmp.put_f32_le(self.pitch);
13254 __tmp.put_f32_le(self.yaw);
13255 __tmp.put_f32_le(self.pitch_rate);
13256 __tmp.put_f32_le(self.yaw_rate);
13257 __tmp.put_u8(self.target_system);
13258 __tmp.put_u8(self.target_component);
13259 __tmp.put_u8(self.gimbal_device_id);
13260 if matches!(version, MavlinkVersion::V2) {
13261 let len = __tmp.len();
13262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13263 } else {
13264 __tmp.len()
13265 }
13266 }
13267}
13268#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13269#[doc = ""]
13270#[doc = "ID: 287"]
13271#[derive(Debug, Clone, PartialEq)]
13272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13274#[cfg_attr(feature = "ts", derive(TS))]
13275#[cfg_attr(feature = "ts", ts(export))]
13276pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13277 #[doc = "High level gimbal manager flags to use."]
13278 pub flags: GimbalManagerFlags,
13279 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13280 pub pitch: f32,
13281 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13282 pub yaw: f32,
13283 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13284 pub pitch_rate: f32,
13285 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13286 pub yaw_rate: f32,
13287 #[doc = "System ID"]
13288 pub target_system: u8,
13289 #[doc = "Component ID"]
13290 pub target_component: u8,
13291 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13292 pub gimbal_device_id: u8,
13293}
13294impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13295 pub const ENCODED_LEN: usize = 23usize;
13296 pub const DEFAULT: Self = Self {
13297 flags: GimbalManagerFlags::DEFAULT,
13298 pitch: 0.0_f32,
13299 yaw: 0.0_f32,
13300 pitch_rate: 0.0_f32,
13301 yaw_rate: 0.0_f32,
13302 target_system: 0_u8,
13303 target_component: 0_u8,
13304 gimbal_device_id: 0_u8,
13305 };
13306 #[cfg(feature = "arbitrary")]
13307 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13308 use arbitrary::{Arbitrary, Unstructured};
13309 let mut buf = [0u8; 1024];
13310 rng.fill_bytes(&mut buf);
13311 let mut unstructured = Unstructured::new(&buf);
13312 Self::arbitrary(&mut unstructured).unwrap_or_default()
13313 }
13314}
13315impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13316 fn default() -> Self {
13317 Self::DEFAULT.clone()
13318 }
13319}
13320impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13321 type Message = MavMessage;
13322 const ID: u32 = 287u32;
13323 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13324 const EXTRA_CRC: u8 = 1u8;
13325 const ENCODED_LEN: usize = 23usize;
13326 fn deser(
13327 _version: MavlinkVersion,
13328 __input: &[u8],
13329 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13330 let avail_len = __input.len();
13331 let mut payload_buf = [0; Self::ENCODED_LEN];
13332 let mut buf = if avail_len < Self::ENCODED_LEN {
13333 payload_buf[0..avail_len].copy_from_slice(__input);
13334 Bytes::new(&payload_buf)
13335 } else {
13336 Bytes::new(__input)
13337 };
13338 let mut __struct = Self::default();
13339 let tmp = buf.get_u32_le();
13340 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13341 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13342 flag_type: "GimbalManagerFlags",
13343 value: tmp as u32,
13344 })?;
13345 __struct.pitch = buf.get_f32_le();
13346 __struct.yaw = buf.get_f32_le();
13347 __struct.pitch_rate = buf.get_f32_le();
13348 __struct.yaw_rate = buf.get_f32_le();
13349 __struct.target_system = buf.get_u8();
13350 __struct.target_component = buf.get_u8();
13351 __struct.gimbal_device_id = buf.get_u8();
13352 Ok(__struct)
13353 }
13354 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13355 let mut __tmp = BytesMut::new(bytes);
13356 #[allow(clippy::absurd_extreme_comparisons)]
13357 #[allow(unused_comparisons)]
13358 if __tmp.remaining() < Self::ENCODED_LEN {
13359 panic!(
13360 "buffer is too small (need {} bytes, but got {})",
13361 Self::ENCODED_LEN,
13362 __tmp.remaining(),
13363 )
13364 }
13365 __tmp.put_u32_le(self.flags.bits());
13366 __tmp.put_f32_le(self.pitch);
13367 __tmp.put_f32_le(self.yaw);
13368 __tmp.put_f32_le(self.pitch_rate);
13369 __tmp.put_f32_le(self.yaw_rate);
13370 __tmp.put_u8(self.target_system);
13371 __tmp.put_u8(self.target_component);
13372 __tmp.put_u8(self.gimbal_device_id);
13373 if matches!(version, MavlinkVersion::V2) {
13374 let len = __tmp.len();
13375 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13376 } else {
13377 __tmp.len()
13378 }
13379 }
13380}
13381#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13382#[doc = ""]
13383#[doc = "ID: 281"]
13384#[derive(Debug, Clone, PartialEq)]
13385#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13387#[cfg_attr(feature = "ts", derive(TS))]
13388#[cfg_attr(feature = "ts", ts(export))]
13389pub struct GIMBAL_MANAGER_STATUS_DATA {
13390 #[doc = "Timestamp (time since system boot)."]
13391 pub time_boot_ms: u32,
13392 #[doc = "High level gimbal manager flags currently applied."]
13393 pub flags: GimbalManagerFlags,
13394 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13395 pub gimbal_device_id: u8,
13396 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13397 pub primary_control_sysid: u8,
13398 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13399 pub primary_control_compid: u8,
13400 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13401 pub secondary_control_sysid: u8,
13402 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13403 pub secondary_control_compid: u8,
13404}
13405impl GIMBAL_MANAGER_STATUS_DATA {
13406 pub const ENCODED_LEN: usize = 13usize;
13407 pub const DEFAULT: Self = Self {
13408 time_boot_ms: 0_u32,
13409 flags: GimbalManagerFlags::DEFAULT,
13410 gimbal_device_id: 0_u8,
13411 primary_control_sysid: 0_u8,
13412 primary_control_compid: 0_u8,
13413 secondary_control_sysid: 0_u8,
13414 secondary_control_compid: 0_u8,
13415 };
13416 #[cfg(feature = "arbitrary")]
13417 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13418 use arbitrary::{Arbitrary, Unstructured};
13419 let mut buf = [0u8; 1024];
13420 rng.fill_bytes(&mut buf);
13421 let mut unstructured = Unstructured::new(&buf);
13422 Self::arbitrary(&mut unstructured).unwrap_or_default()
13423 }
13424}
13425impl Default for GIMBAL_MANAGER_STATUS_DATA {
13426 fn default() -> Self {
13427 Self::DEFAULT.clone()
13428 }
13429}
13430impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13431 type Message = MavMessage;
13432 const ID: u32 = 281u32;
13433 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13434 const EXTRA_CRC: u8 = 48u8;
13435 const ENCODED_LEN: usize = 13usize;
13436 fn deser(
13437 _version: MavlinkVersion,
13438 __input: &[u8],
13439 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13440 let avail_len = __input.len();
13441 let mut payload_buf = [0; Self::ENCODED_LEN];
13442 let mut buf = if avail_len < Self::ENCODED_LEN {
13443 payload_buf[0..avail_len].copy_from_slice(__input);
13444 Bytes::new(&payload_buf)
13445 } else {
13446 Bytes::new(__input)
13447 };
13448 let mut __struct = Self::default();
13449 __struct.time_boot_ms = buf.get_u32_le();
13450 let tmp = buf.get_u32_le();
13451 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13452 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13453 flag_type: "GimbalManagerFlags",
13454 value: tmp as u32,
13455 })?;
13456 __struct.gimbal_device_id = buf.get_u8();
13457 __struct.primary_control_sysid = buf.get_u8();
13458 __struct.primary_control_compid = buf.get_u8();
13459 __struct.secondary_control_sysid = buf.get_u8();
13460 __struct.secondary_control_compid = buf.get_u8();
13461 Ok(__struct)
13462 }
13463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13464 let mut __tmp = BytesMut::new(bytes);
13465 #[allow(clippy::absurd_extreme_comparisons)]
13466 #[allow(unused_comparisons)]
13467 if __tmp.remaining() < Self::ENCODED_LEN {
13468 panic!(
13469 "buffer is too small (need {} bytes, but got {})",
13470 Self::ENCODED_LEN,
13471 __tmp.remaining(),
13472 )
13473 }
13474 __tmp.put_u32_le(self.time_boot_ms);
13475 __tmp.put_u32_le(self.flags.bits());
13476 __tmp.put_u8(self.gimbal_device_id);
13477 __tmp.put_u8(self.primary_control_sysid);
13478 __tmp.put_u8(self.primary_control_compid);
13479 __tmp.put_u8(self.secondary_control_sysid);
13480 __tmp.put_u8(self.secondary_control_compid);
13481 if matches!(version, MavlinkVersion::V2) {
13482 let len = __tmp.len();
13483 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13484 } else {
13485 __tmp.len()
13486 }
13487 }
13488}
13489#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13490#[doc = ""]
13491#[doc = "ID: 33"]
13492#[derive(Debug, Clone, PartialEq)]
13493#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13495#[cfg_attr(feature = "ts", derive(TS))]
13496#[cfg_attr(feature = "ts", ts(export))]
13497pub struct GLOBAL_POSITION_INT_DATA {
13498 #[doc = "Timestamp (time since system boot)."]
13499 pub time_boot_ms: u32,
13500 #[doc = "Latitude, expressed"]
13501 pub lat: i32,
13502 #[doc = "Longitude, expressed"]
13503 pub lon: i32,
13504 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13505 pub alt: i32,
13506 #[doc = "Altitude above home"]
13507 pub relative_alt: i32,
13508 #[doc = "Ground X Speed (Latitude, positive north)"]
13509 pub vx: i16,
13510 #[doc = "Ground Y Speed (Longitude, positive east)"]
13511 pub vy: i16,
13512 #[doc = "Ground Z Speed (Altitude, positive down)"]
13513 pub vz: i16,
13514 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13515 pub hdg: u16,
13516}
13517impl GLOBAL_POSITION_INT_DATA {
13518 pub const ENCODED_LEN: usize = 28usize;
13519 pub const DEFAULT: Self = Self {
13520 time_boot_ms: 0_u32,
13521 lat: 0_i32,
13522 lon: 0_i32,
13523 alt: 0_i32,
13524 relative_alt: 0_i32,
13525 vx: 0_i16,
13526 vy: 0_i16,
13527 vz: 0_i16,
13528 hdg: 0_u16,
13529 };
13530 #[cfg(feature = "arbitrary")]
13531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13532 use arbitrary::{Arbitrary, Unstructured};
13533 let mut buf = [0u8; 1024];
13534 rng.fill_bytes(&mut buf);
13535 let mut unstructured = Unstructured::new(&buf);
13536 Self::arbitrary(&mut unstructured).unwrap_or_default()
13537 }
13538}
13539impl Default for GLOBAL_POSITION_INT_DATA {
13540 fn default() -> Self {
13541 Self::DEFAULT.clone()
13542 }
13543}
13544impl MessageData for GLOBAL_POSITION_INT_DATA {
13545 type Message = MavMessage;
13546 const ID: u32 = 33u32;
13547 const NAME: &'static str = "GLOBAL_POSITION_INT";
13548 const EXTRA_CRC: u8 = 104u8;
13549 const ENCODED_LEN: usize = 28usize;
13550 fn deser(
13551 _version: MavlinkVersion,
13552 __input: &[u8],
13553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13554 let avail_len = __input.len();
13555 let mut payload_buf = [0; Self::ENCODED_LEN];
13556 let mut buf = if avail_len < Self::ENCODED_LEN {
13557 payload_buf[0..avail_len].copy_from_slice(__input);
13558 Bytes::new(&payload_buf)
13559 } else {
13560 Bytes::new(__input)
13561 };
13562 let mut __struct = Self::default();
13563 __struct.time_boot_ms = buf.get_u32_le();
13564 __struct.lat = buf.get_i32_le();
13565 __struct.lon = buf.get_i32_le();
13566 __struct.alt = buf.get_i32_le();
13567 __struct.relative_alt = buf.get_i32_le();
13568 __struct.vx = buf.get_i16_le();
13569 __struct.vy = buf.get_i16_le();
13570 __struct.vz = buf.get_i16_le();
13571 __struct.hdg = buf.get_u16_le();
13572 Ok(__struct)
13573 }
13574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13575 let mut __tmp = BytesMut::new(bytes);
13576 #[allow(clippy::absurd_extreme_comparisons)]
13577 #[allow(unused_comparisons)]
13578 if __tmp.remaining() < Self::ENCODED_LEN {
13579 panic!(
13580 "buffer is too small (need {} bytes, but got {})",
13581 Self::ENCODED_LEN,
13582 __tmp.remaining(),
13583 )
13584 }
13585 __tmp.put_u32_le(self.time_boot_ms);
13586 __tmp.put_i32_le(self.lat);
13587 __tmp.put_i32_le(self.lon);
13588 __tmp.put_i32_le(self.alt);
13589 __tmp.put_i32_le(self.relative_alt);
13590 __tmp.put_i16_le(self.vx);
13591 __tmp.put_i16_le(self.vy);
13592 __tmp.put_i16_le(self.vz);
13593 __tmp.put_u16_le(self.hdg);
13594 if matches!(version, MavlinkVersion::V2) {
13595 let len = __tmp.len();
13596 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13597 } else {
13598 __tmp.len()
13599 }
13600 }
13601}
13602#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13603#[doc = ""]
13604#[doc = "ID: 63"]
13605#[derive(Debug, Clone, PartialEq)]
13606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13607#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13608#[cfg_attr(feature = "ts", derive(TS))]
13609#[cfg_attr(feature = "ts", ts(export))]
13610pub struct GLOBAL_POSITION_INT_COV_DATA {
13611 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13612 pub time_usec: u64,
13613 #[doc = "Latitude"]
13614 pub lat: i32,
13615 #[doc = "Longitude"]
13616 pub lon: i32,
13617 #[doc = "Altitude in meters above MSL"]
13618 pub alt: i32,
13619 #[doc = "Altitude above ground"]
13620 pub relative_alt: i32,
13621 #[doc = "Ground X Speed (Latitude)"]
13622 pub vx: f32,
13623 #[doc = "Ground Y Speed (Longitude)"]
13624 pub vy: f32,
13625 #[doc = "Ground Z Speed (Altitude)"]
13626 pub vz: f32,
13627 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13628 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13629 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13630 pub covariance: [f32; 36],
13631 #[doc = "Class id of the estimator this estimate originated from."]
13632 pub estimator_type: MavEstimatorType,
13633}
13634impl GLOBAL_POSITION_INT_COV_DATA {
13635 pub const ENCODED_LEN: usize = 181usize;
13636 pub const DEFAULT: Self = Self {
13637 time_usec: 0_u64,
13638 lat: 0_i32,
13639 lon: 0_i32,
13640 alt: 0_i32,
13641 relative_alt: 0_i32,
13642 vx: 0.0_f32,
13643 vy: 0.0_f32,
13644 vz: 0.0_f32,
13645 covariance: [0.0_f32; 36usize],
13646 estimator_type: MavEstimatorType::DEFAULT,
13647 };
13648 #[cfg(feature = "arbitrary")]
13649 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13650 use arbitrary::{Arbitrary, Unstructured};
13651 let mut buf = [0u8; 1024];
13652 rng.fill_bytes(&mut buf);
13653 let mut unstructured = Unstructured::new(&buf);
13654 Self::arbitrary(&mut unstructured).unwrap_or_default()
13655 }
13656}
13657impl Default for GLOBAL_POSITION_INT_COV_DATA {
13658 fn default() -> Self {
13659 Self::DEFAULT.clone()
13660 }
13661}
13662impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13663 type Message = MavMessage;
13664 const ID: u32 = 63u32;
13665 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13666 const EXTRA_CRC: u8 = 119u8;
13667 const ENCODED_LEN: usize = 181usize;
13668 fn deser(
13669 _version: MavlinkVersion,
13670 __input: &[u8],
13671 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13672 let avail_len = __input.len();
13673 let mut payload_buf = [0; Self::ENCODED_LEN];
13674 let mut buf = if avail_len < Self::ENCODED_LEN {
13675 payload_buf[0..avail_len].copy_from_slice(__input);
13676 Bytes::new(&payload_buf)
13677 } else {
13678 Bytes::new(__input)
13679 };
13680 let mut __struct = Self::default();
13681 __struct.time_usec = buf.get_u64_le();
13682 __struct.lat = buf.get_i32_le();
13683 __struct.lon = buf.get_i32_le();
13684 __struct.alt = buf.get_i32_le();
13685 __struct.relative_alt = buf.get_i32_le();
13686 __struct.vx = buf.get_f32_le();
13687 __struct.vy = buf.get_f32_le();
13688 __struct.vz = buf.get_f32_le();
13689 for v in &mut __struct.covariance {
13690 let val = buf.get_f32_le();
13691 *v = val;
13692 }
13693 let tmp = buf.get_u8();
13694 __struct.estimator_type =
13695 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13696 enum_type: "MavEstimatorType",
13697 value: tmp as u32,
13698 })?;
13699 Ok(__struct)
13700 }
13701 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13702 let mut __tmp = BytesMut::new(bytes);
13703 #[allow(clippy::absurd_extreme_comparisons)]
13704 #[allow(unused_comparisons)]
13705 if __tmp.remaining() < Self::ENCODED_LEN {
13706 panic!(
13707 "buffer is too small (need {} bytes, but got {})",
13708 Self::ENCODED_LEN,
13709 __tmp.remaining(),
13710 )
13711 }
13712 __tmp.put_u64_le(self.time_usec);
13713 __tmp.put_i32_le(self.lat);
13714 __tmp.put_i32_le(self.lon);
13715 __tmp.put_i32_le(self.alt);
13716 __tmp.put_i32_le(self.relative_alt);
13717 __tmp.put_f32_le(self.vx);
13718 __tmp.put_f32_le(self.vy);
13719 __tmp.put_f32_le(self.vz);
13720 for val in &self.covariance {
13721 __tmp.put_f32_le(*val);
13722 }
13723 __tmp.put_u8(self.estimator_type as u8);
13724 if matches!(version, MavlinkVersion::V2) {
13725 let len = __tmp.len();
13726 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13727 } else {
13728 __tmp.len()
13729 }
13730 }
13731}
13732#[doc = "Global position/attitude estimate from a vision source."]
13733#[doc = ""]
13734#[doc = "ID: 101"]
13735#[derive(Debug, Clone, PartialEq)]
13736#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13738#[cfg_attr(feature = "ts", derive(TS))]
13739#[cfg_attr(feature = "ts", ts(export))]
13740pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13741 #[doc = "Timestamp (UNIX time or since system boot)"]
13742 pub usec: u64,
13743 #[doc = "Global X position"]
13744 pub x: f32,
13745 #[doc = "Global Y position"]
13746 pub y: f32,
13747 #[doc = "Global Z position"]
13748 pub z: f32,
13749 #[doc = "Roll angle"]
13750 pub roll: f32,
13751 #[doc = "Pitch angle"]
13752 pub pitch: f32,
13753 #[doc = "Yaw angle"]
13754 pub yaw: f32,
13755 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13756 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13757 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13758 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13759 pub covariance: [f32; 21],
13760 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13761 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13762 pub reset_counter: u8,
13763}
13764impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13765 pub const ENCODED_LEN: usize = 117usize;
13766 pub const DEFAULT: Self = Self {
13767 usec: 0_u64,
13768 x: 0.0_f32,
13769 y: 0.0_f32,
13770 z: 0.0_f32,
13771 roll: 0.0_f32,
13772 pitch: 0.0_f32,
13773 yaw: 0.0_f32,
13774 covariance: [0.0_f32; 21usize],
13775 reset_counter: 0_u8,
13776 };
13777 #[cfg(feature = "arbitrary")]
13778 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13779 use arbitrary::{Arbitrary, Unstructured};
13780 let mut buf = [0u8; 1024];
13781 rng.fill_bytes(&mut buf);
13782 let mut unstructured = Unstructured::new(&buf);
13783 Self::arbitrary(&mut unstructured).unwrap_or_default()
13784 }
13785}
13786impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13787 fn default() -> Self {
13788 Self::DEFAULT.clone()
13789 }
13790}
13791impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13792 type Message = MavMessage;
13793 const ID: u32 = 101u32;
13794 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13795 const EXTRA_CRC: u8 = 102u8;
13796 const ENCODED_LEN: usize = 117usize;
13797 fn deser(
13798 _version: MavlinkVersion,
13799 __input: &[u8],
13800 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13801 let avail_len = __input.len();
13802 let mut payload_buf = [0; Self::ENCODED_LEN];
13803 let mut buf = if avail_len < Self::ENCODED_LEN {
13804 payload_buf[0..avail_len].copy_from_slice(__input);
13805 Bytes::new(&payload_buf)
13806 } else {
13807 Bytes::new(__input)
13808 };
13809 let mut __struct = Self::default();
13810 __struct.usec = buf.get_u64_le();
13811 __struct.x = buf.get_f32_le();
13812 __struct.y = buf.get_f32_le();
13813 __struct.z = buf.get_f32_le();
13814 __struct.roll = buf.get_f32_le();
13815 __struct.pitch = buf.get_f32_le();
13816 __struct.yaw = buf.get_f32_le();
13817 for v in &mut __struct.covariance {
13818 let val = buf.get_f32_le();
13819 *v = val;
13820 }
13821 __struct.reset_counter = buf.get_u8();
13822 Ok(__struct)
13823 }
13824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13825 let mut __tmp = BytesMut::new(bytes);
13826 #[allow(clippy::absurd_extreme_comparisons)]
13827 #[allow(unused_comparisons)]
13828 if __tmp.remaining() < Self::ENCODED_LEN {
13829 panic!(
13830 "buffer is too small (need {} bytes, but got {})",
13831 Self::ENCODED_LEN,
13832 __tmp.remaining(),
13833 )
13834 }
13835 __tmp.put_u64_le(self.usec);
13836 __tmp.put_f32_le(self.x);
13837 __tmp.put_f32_le(self.y);
13838 __tmp.put_f32_le(self.z);
13839 __tmp.put_f32_le(self.roll);
13840 __tmp.put_f32_le(self.pitch);
13841 __tmp.put_f32_le(self.yaw);
13842 if matches!(version, MavlinkVersion::V2) {
13843 for val in &self.covariance {
13844 __tmp.put_f32_le(*val);
13845 }
13846 __tmp.put_u8(self.reset_counter);
13847 let len = __tmp.len();
13848 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13849 } else {
13850 __tmp.len()
13851 }
13852 }
13853}
13854#[doc = "Second GPS data."]
13855#[doc = ""]
13856#[doc = "ID: 124"]
13857#[derive(Debug, Clone, PartialEq)]
13858#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13859#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13860#[cfg_attr(feature = "ts", derive(TS))]
13861#[cfg_attr(feature = "ts", ts(export))]
13862pub struct GPS2_RAW_DATA {
13863 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13864 pub time_usec: u64,
13865 #[doc = "Latitude (WGS84)"]
13866 pub lat: i32,
13867 #[doc = "Longitude (WGS84)"]
13868 pub lon: i32,
13869 #[doc = "Altitude (MSL). Positive for up."]
13870 pub alt: i32,
13871 #[doc = "Age of DGPS info"]
13872 pub dgps_age: u32,
13873 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13874 pub eph: u16,
13875 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13876 pub epv: u16,
13877 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13878 pub vel: u16,
13879 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13880 pub cog: u16,
13881 #[doc = "GPS fix type."]
13882 pub fix_type: GpsFixType,
13883 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13884 pub satellites_visible: u8,
13885 #[doc = "Number of DGPS satellites"]
13886 pub dgps_numch: u8,
13887 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13888 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13889 pub yaw: u16,
13890 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13891 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13892 pub alt_ellipsoid: i32,
13893 #[doc = "Position uncertainty."]
13894 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13895 pub h_acc: u32,
13896 #[doc = "Altitude uncertainty."]
13897 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13898 pub v_acc: u32,
13899 #[doc = "Speed uncertainty."]
13900 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13901 pub vel_acc: u32,
13902 #[doc = "Heading / track uncertainty"]
13903 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13904 pub hdg_acc: u32,
13905}
13906impl GPS2_RAW_DATA {
13907 pub const ENCODED_LEN: usize = 57usize;
13908 pub const DEFAULT: Self = Self {
13909 time_usec: 0_u64,
13910 lat: 0_i32,
13911 lon: 0_i32,
13912 alt: 0_i32,
13913 dgps_age: 0_u32,
13914 eph: 0_u16,
13915 epv: 0_u16,
13916 vel: 0_u16,
13917 cog: 0_u16,
13918 fix_type: GpsFixType::DEFAULT,
13919 satellites_visible: 0_u8,
13920 dgps_numch: 0_u8,
13921 yaw: 0_u16,
13922 alt_ellipsoid: 0_i32,
13923 h_acc: 0_u32,
13924 v_acc: 0_u32,
13925 vel_acc: 0_u32,
13926 hdg_acc: 0_u32,
13927 };
13928 #[cfg(feature = "arbitrary")]
13929 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13930 use arbitrary::{Arbitrary, Unstructured};
13931 let mut buf = [0u8; 1024];
13932 rng.fill_bytes(&mut buf);
13933 let mut unstructured = Unstructured::new(&buf);
13934 Self::arbitrary(&mut unstructured).unwrap_or_default()
13935 }
13936}
13937impl Default for GPS2_RAW_DATA {
13938 fn default() -> Self {
13939 Self::DEFAULT.clone()
13940 }
13941}
13942impl MessageData for GPS2_RAW_DATA {
13943 type Message = MavMessage;
13944 const ID: u32 = 124u32;
13945 const NAME: &'static str = "GPS2_RAW";
13946 const EXTRA_CRC: u8 = 87u8;
13947 const ENCODED_LEN: usize = 57usize;
13948 fn deser(
13949 _version: MavlinkVersion,
13950 __input: &[u8],
13951 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13952 let avail_len = __input.len();
13953 let mut payload_buf = [0; Self::ENCODED_LEN];
13954 let mut buf = if avail_len < Self::ENCODED_LEN {
13955 payload_buf[0..avail_len].copy_from_slice(__input);
13956 Bytes::new(&payload_buf)
13957 } else {
13958 Bytes::new(__input)
13959 };
13960 let mut __struct = Self::default();
13961 __struct.time_usec = buf.get_u64_le();
13962 __struct.lat = buf.get_i32_le();
13963 __struct.lon = buf.get_i32_le();
13964 __struct.alt = buf.get_i32_le();
13965 __struct.dgps_age = buf.get_u32_le();
13966 __struct.eph = buf.get_u16_le();
13967 __struct.epv = buf.get_u16_le();
13968 __struct.vel = buf.get_u16_le();
13969 __struct.cog = buf.get_u16_le();
13970 let tmp = buf.get_u8();
13971 __struct.fix_type =
13972 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13973 enum_type: "GpsFixType",
13974 value: tmp as u32,
13975 })?;
13976 __struct.satellites_visible = buf.get_u8();
13977 __struct.dgps_numch = buf.get_u8();
13978 __struct.yaw = buf.get_u16_le();
13979 __struct.alt_ellipsoid = buf.get_i32_le();
13980 __struct.h_acc = buf.get_u32_le();
13981 __struct.v_acc = buf.get_u32_le();
13982 __struct.vel_acc = buf.get_u32_le();
13983 __struct.hdg_acc = buf.get_u32_le();
13984 Ok(__struct)
13985 }
13986 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13987 let mut __tmp = BytesMut::new(bytes);
13988 #[allow(clippy::absurd_extreme_comparisons)]
13989 #[allow(unused_comparisons)]
13990 if __tmp.remaining() < Self::ENCODED_LEN {
13991 panic!(
13992 "buffer is too small (need {} bytes, but got {})",
13993 Self::ENCODED_LEN,
13994 __tmp.remaining(),
13995 )
13996 }
13997 __tmp.put_u64_le(self.time_usec);
13998 __tmp.put_i32_le(self.lat);
13999 __tmp.put_i32_le(self.lon);
14000 __tmp.put_i32_le(self.alt);
14001 __tmp.put_u32_le(self.dgps_age);
14002 __tmp.put_u16_le(self.eph);
14003 __tmp.put_u16_le(self.epv);
14004 __tmp.put_u16_le(self.vel);
14005 __tmp.put_u16_le(self.cog);
14006 __tmp.put_u8(self.fix_type as u8);
14007 __tmp.put_u8(self.satellites_visible);
14008 __tmp.put_u8(self.dgps_numch);
14009 if matches!(version, MavlinkVersion::V2) {
14010 __tmp.put_u16_le(self.yaw);
14011 __tmp.put_i32_le(self.alt_ellipsoid);
14012 __tmp.put_u32_le(self.h_acc);
14013 __tmp.put_u32_le(self.v_acc);
14014 __tmp.put_u32_le(self.vel_acc);
14015 __tmp.put_u32_le(self.hdg_acc);
14016 let len = __tmp.len();
14017 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14018 } else {
14019 __tmp.len()
14020 }
14021 }
14022}
14023#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14024#[doc = ""]
14025#[doc = "ID: 128"]
14026#[derive(Debug, Clone, PartialEq)]
14027#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14028#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14029#[cfg_attr(feature = "ts", derive(TS))]
14030#[cfg_attr(feature = "ts", ts(export))]
14031pub struct GPS2_RTK_DATA {
14032 #[doc = "Time since boot of last baseline message received."]
14033 pub time_last_baseline_ms: u32,
14034 #[doc = "GPS Time of Week of last baseline"]
14035 pub tow: u32,
14036 #[doc = "Current baseline in ECEF x or NED north component."]
14037 pub baseline_a_mm: i32,
14038 #[doc = "Current baseline in ECEF y or NED east component."]
14039 pub baseline_b_mm: i32,
14040 #[doc = "Current baseline in ECEF z or NED down component."]
14041 pub baseline_c_mm: i32,
14042 #[doc = "Current estimate of baseline accuracy."]
14043 pub accuracy: u32,
14044 #[doc = "Current number of integer ambiguity hypotheses."]
14045 pub iar_num_hypotheses: i32,
14046 #[doc = "GPS Week Number of last baseline"]
14047 pub wn: u16,
14048 #[doc = "Identification of connected RTK receiver."]
14049 pub rtk_receiver_id: u8,
14050 #[doc = "GPS-specific health report for RTK data."]
14051 pub rtk_health: u8,
14052 #[doc = "Rate of baseline messages being received by GPS"]
14053 pub rtk_rate: u8,
14054 #[doc = "Current number of sats used for RTK calculation."]
14055 pub nsats: u8,
14056 #[doc = "Coordinate system of baseline"]
14057 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14058}
14059impl GPS2_RTK_DATA {
14060 pub const ENCODED_LEN: usize = 35usize;
14061 pub const DEFAULT: Self = Self {
14062 time_last_baseline_ms: 0_u32,
14063 tow: 0_u32,
14064 baseline_a_mm: 0_i32,
14065 baseline_b_mm: 0_i32,
14066 baseline_c_mm: 0_i32,
14067 accuracy: 0_u32,
14068 iar_num_hypotheses: 0_i32,
14069 wn: 0_u16,
14070 rtk_receiver_id: 0_u8,
14071 rtk_health: 0_u8,
14072 rtk_rate: 0_u8,
14073 nsats: 0_u8,
14074 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14075 };
14076 #[cfg(feature = "arbitrary")]
14077 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14078 use arbitrary::{Arbitrary, Unstructured};
14079 let mut buf = [0u8; 1024];
14080 rng.fill_bytes(&mut buf);
14081 let mut unstructured = Unstructured::new(&buf);
14082 Self::arbitrary(&mut unstructured).unwrap_or_default()
14083 }
14084}
14085impl Default for GPS2_RTK_DATA {
14086 fn default() -> Self {
14087 Self::DEFAULT.clone()
14088 }
14089}
14090impl MessageData for GPS2_RTK_DATA {
14091 type Message = MavMessage;
14092 const ID: u32 = 128u32;
14093 const NAME: &'static str = "GPS2_RTK";
14094 const EXTRA_CRC: u8 = 226u8;
14095 const ENCODED_LEN: usize = 35usize;
14096 fn deser(
14097 _version: MavlinkVersion,
14098 __input: &[u8],
14099 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14100 let avail_len = __input.len();
14101 let mut payload_buf = [0; Self::ENCODED_LEN];
14102 let mut buf = if avail_len < Self::ENCODED_LEN {
14103 payload_buf[0..avail_len].copy_from_slice(__input);
14104 Bytes::new(&payload_buf)
14105 } else {
14106 Bytes::new(__input)
14107 };
14108 let mut __struct = Self::default();
14109 __struct.time_last_baseline_ms = buf.get_u32_le();
14110 __struct.tow = buf.get_u32_le();
14111 __struct.baseline_a_mm = buf.get_i32_le();
14112 __struct.baseline_b_mm = buf.get_i32_le();
14113 __struct.baseline_c_mm = buf.get_i32_le();
14114 __struct.accuracy = buf.get_u32_le();
14115 __struct.iar_num_hypotheses = buf.get_i32_le();
14116 __struct.wn = buf.get_u16_le();
14117 __struct.rtk_receiver_id = buf.get_u8();
14118 __struct.rtk_health = buf.get_u8();
14119 __struct.rtk_rate = buf.get_u8();
14120 __struct.nsats = buf.get_u8();
14121 let tmp = buf.get_u8();
14122 __struct.baseline_coords_type =
14123 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14124 enum_type: "RtkBaselineCoordinateSystem",
14125 value: tmp as u32,
14126 })?;
14127 Ok(__struct)
14128 }
14129 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14130 let mut __tmp = BytesMut::new(bytes);
14131 #[allow(clippy::absurd_extreme_comparisons)]
14132 #[allow(unused_comparisons)]
14133 if __tmp.remaining() < Self::ENCODED_LEN {
14134 panic!(
14135 "buffer is too small (need {} bytes, but got {})",
14136 Self::ENCODED_LEN,
14137 __tmp.remaining(),
14138 )
14139 }
14140 __tmp.put_u32_le(self.time_last_baseline_ms);
14141 __tmp.put_u32_le(self.tow);
14142 __tmp.put_i32_le(self.baseline_a_mm);
14143 __tmp.put_i32_le(self.baseline_b_mm);
14144 __tmp.put_i32_le(self.baseline_c_mm);
14145 __tmp.put_u32_le(self.accuracy);
14146 __tmp.put_i32_le(self.iar_num_hypotheses);
14147 __tmp.put_u16_le(self.wn);
14148 __tmp.put_u8(self.rtk_receiver_id);
14149 __tmp.put_u8(self.rtk_health);
14150 __tmp.put_u8(self.rtk_rate);
14151 __tmp.put_u8(self.nsats);
14152 __tmp.put_u8(self.baseline_coords_type as u8);
14153 if matches!(version, MavlinkVersion::V2) {
14154 let len = __tmp.len();
14155 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14156 } else {
14157 __tmp.len()
14158 }
14159 }
14160}
14161#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14162#[doc = ""]
14163#[doc = "ID: 49"]
14164#[derive(Debug, Clone, PartialEq)]
14165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14167#[cfg_attr(feature = "ts", derive(TS))]
14168#[cfg_attr(feature = "ts", ts(export))]
14169pub struct GPS_GLOBAL_ORIGIN_DATA {
14170 #[doc = "Latitude (WGS84)"]
14171 pub latitude: i32,
14172 #[doc = "Longitude (WGS84)"]
14173 pub longitude: i32,
14174 #[doc = "Altitude (MSL). Positive for up."]
14175 pub altitude: i32,
14176 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14177 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14178 pub time_usec: u64,
14179}
14180impl GPS_GLOBAL_ORIGIN_DATA {
14181 pub const ENCODED_LEN: usize = 20usize;
14182 pub const DEFAULT: Self = Self {
14183 latitude: 0_i32,
14184 longitude: 0_i32,
14185 altitude: 0_i32,
14186 time_usec: 0_u64,
14187 };
14188 #[cfg(feature = "arbitrary")]
14189 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14190 use arbitrary::{Arbitrary, Unstructured};
14191 let mut buf = [0u8; 1024];
14192 rng.fill_bytes(&mut buf);
14193 let mut unstructured = Unstructured::new(&buf);
14194 Self::arbitrary(&mut unstructured).unwrap_or_default()
14195 }
14196}
14197impl Default for GPS_GLOBAL_ORIGIN_DATA {
14198 fn default() -> Self {
14199 Self::DEFAULT.clone()
14200 }
14201}
14202impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14203 type Message = MavMessage;
14204 const ID: u32 = 49u32;
14205 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14206 const EXTRA_CRC: u8 = 39u8;
14207 const ENCODED_LEN: usize = 20usize;
14208 fn deser(
14209 _version: MavlinkVersion,
14210 __input: &[u8],
14211 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14212 let avail_len = __input.len();
14213 let mut payload_buf = [0; Self::ENCODED_LEN];
14214 let mut buf = if avail_len < Self::ENCODED_LEN {
14215 payload_buf[0..avail_len].copy_from_slice(__input);
14216 Bytes::new(&payload_buf)
14217 } else {
14218 Bytes::new(__input)
14219 };
14220 let mut __struct = Self::default();
14221 __struct.latitude = buf.get_i32_le();
14222 __struct.longitude = buf.get_i32_le();
14223 __struct.altitude = buf.get_i32_le();
14224 __struct.time_usec = buf.get_u64_le();
14225 Ok(__struct)
14226 }
14227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14228 let mut __tmp = BytesMut::new(bytes);
14229 #[allow(clippy::absurd_extreme_comparisons)]
14230 #[allow(unused_comparisons)]
14231 if __tmp.remaining() < Self::ENCODED_LEN {
14232 panic!(
14233 "buffer is too small (need {} bytes, but got {})",
14234 Self::ENCODED_LEN,
14235 __tmp.remaining(),
14236 )
14237 }
14238 __tmp.put_i32_le(self.latitude);
14239 __tmp.put_i32_le(self.longitude);
14240 __tmp.put_i32_le(self.altitude);
14241 if matches!(version, MavlinkVersion::V2) {
14242 __tmp.put_u64_le(self.time_usec);
14243 let len = __tmp.len();
14244 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14245 } else {
14246 __tmp.len()
14247 }
14248 }
14249}
14250#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14251#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14252#[doc = ""]
14253#[doc = "ID: 123"]
14254#[derive(Debug, Clone, PartialEq)]
14255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14257#[cfg_attr(feature = "ts", derive(TS))]
14258#[cfg_attr(feature = "ts", ts(export))]
14259pub struct GPS_INJECT_DATA_DATA {
14260 #[doc = "System ID"]
14261 pub target_system: u8,
14262 #[doc = "Component ID"]
14263 pub target_component: u8,
14264 #[doc = "Data length"]
14265 pub len: u8,
14266 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14267 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14268 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14269 pub data: [u8; 110],
14270}
14271impl GPS_INJECT_DATA_DATA {
14272 pub const ENCODED_LEN: usize = 113usize;
14273 pub const DEFAULT: Self = Self {
14274 target_system: 0_u8,
14275 target_component: 0_u8,
14276 len: 0_u8,
14277 data: [0_u8; 110usize],
14278 };
14279 #[cfg(feature = "arbitrary")]
14280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14281 use arbitrary::{Arbitrary, Unstructured};
14282 let mut buf = [0u8; 1024];
14283 rng.fill_bytes(&mut buf);
14284 let mut unstructured = Unstructured::new(&buf);
14285 Self::arbitrary(&mut unstructured).unwrap_or_default()
14286 }
14287}
14288impl Default for GPS_INJECT_DATA_DATA {
14289 fn default() -> Self {
14290 Self::DEFAULT.clone()
14291 }
14292}
14293impl MessageData for GPS_INJECT_DATA_DATA {
14294 type Message = MavMessage;
14295 const ID: u32 = 123u32;
14296 const NAME: &'static str = "GPS_INJECT_DATA";
14297 const EXTRA_CRC: u8 = 250u8;
14298 const ENCODED_LEN: usize = 113usize;
14299 fn deser(
14300 _version: MavlinkVersion,
14301 __input: &[u8],
14302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14303 let avail_len = __input.len();
14304 let mut payload_buf = [0; Self::ENCODED_LEN];
14305 let mut buf = if avail_len < Self::ENCODED_LEN {
14306 payload_buf[0..avail_len].copy_from_slice(__input);
14307 Bytes::new(&payload_buf)
14308 } else {
14309 Bytes::new(__input)
14310 };
14311 let mut __struct = Self::default();
14312 __struct.target_system = buf.get_u8();
14313 __struct.target_component = buf.get_u8();
14314 __struct.len = buf.get_u8();
14315 for v in &mut __struct.data {
14316 let val = buf.get_u8();
14317 *v = val;
14318 }
14319 Ok(__struct)
14320 }
14321 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14322 let mut __tmp = BytesMut::new(bytes);
14323 #[allow(clippy::absurd_extreme_comparisons)]
14324 #[allow(unused_comparisons)]
14325 if __tmp.remaining() < Self::ENCODED_LEN {
14326 panic!(
14327 "buffer is too small (need {} bytes, but got {})",
14328 Self::ENCODED_LEN,
14329 __tmp.remaining(),
14330 )
14331 }
14332 __tmp.put_u8(self.target_system);
14333 __tmp.put_u8(self.target_component);
14334 __tmp.put_u8(self.len);
14335 for val in &self.data {
14336 __tmp.put_u8(*val);
14337 }
14338 if matches!(version, MavlinkVersion::V2) {
14339 let len = __tmp.len();
14340 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14341 } else {
14342 __tmp.len()
14343 }
14344 }
14345}
14346#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14347#[doc = ""]
14348#[doc = "ID: 232"]
14349#[derive(Debug, Clone, PartialEq)]
14350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14352#[cfg_attr(feature = "ts", derive(TS))]
14353#[cfg_attr(feature = "ts", ts(export))]
14354pub struct GPS_INPUT_DATA {
14355 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14356 pub time_usec: u64,
14357 #[doc = "GPS time (from start of GPS week)"]
14358 pub time_week_ms: u32,
14359 #[doc = "Latitude (WGS84)"]
14360 pub lat: i32,
14361 #[doc = "Longitude (WGS84)"]
14362 pub lon: i32,
14363 #[doc = "Altitude (MSL). Positive for up."]
14364 pub alt: f32,
14365 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14366 pub hdop: f32,
14367 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14368 pub vdop: f32,
14369 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14370 pub vn: f32,
14371 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14372 pub ve: f32,
14373 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14374 pub vd: f32,
14375 #[doc = "GPS speed accuracy"]
14376 pub speed_accuracy: f32,
14377 #[doc = "GPS horizontal accuracy"]
14378 pub horiz_accuracy: f32,
14379 #[doc = "GPS vertical accuracy"]
14380 pub vert_accuracy: f32,
14381 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14382 pub ignore_flags: GpsInputIgnoreFlags,
14383 #[doc = "GPS week number"]
14384 pub time_week: u16,
14385 #[doc = "ID of the GPS for multiple GPS inputs"]
14386 pub gps_id: u8,
14387 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14388 pub fix_type: u8,
14389 #[doc = "Number of satellites visible."]
14390 pub satellites_visible: u8,
14391 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14392 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14393 pub yaw: u16,
14394}
14395impl GPS_INPUT_DATA {
14396 pub const ENCODED_LEN: usize = 65usize;
14397 pub const DEFAULT: Self = Self {
14398 time_usec: 0_u64,
14399 time_week_ms: 0_u32,
14400 lat: 0_i32,
14401 lon: 0_i32,
14402 alt: 0.0_f32,
14403 hdop: 0.0_f32,
14404 vdop: 0.0_f32,
14405 vn: 0.0_f32,
14406 ve: 0.0_f32,
14407 vd: 0.0_f32,
14408 speed_accuracy: 0.0_f32,
14409 horiz_accuracy: 0.0_f32,
14410 vert_accuracy: 0.0_f32,
14411 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14412 time_week: 0_u16,
14413 gps_id: 0_u8,
14414 fix_type: 0_u8,
14415 satellites_visible: 0_u8,
14416 yaw: 0_u16,
14417 };
14418 #[cfg(feature = "arbitrary")]
14419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14420 use arbitrary::{Arbitrary, Unstructured};
14421 let mut buf = [0u8; 1024];
14422 rng.fill_bytes(&mut buf);
14423 let mut unstructured = Unstructured::new(&buf);
14424 Self::arbitrary(&mut unstructured).unwrap_or_default()
14425 }
14426}
14427impl Default for GPS_INPUT_DATA {
14428 fn default() -> Self {
14429 Self::DEFAULT.clone()
14430 }
14431}
14432impl MessageData for GPS_INPUT_DATA {
14433 type Message = MavMessage;
14434 const ID: u32 = 232u32;
14435 const NAME: &'static str = "GPS_INPUT";
14436 const EXTRA_CRC: u8 = 151u8;
14437 const ENCODED_LEN: usize = 65usize;
14438 fn deser(
14439 _version: MavlinkVersion,
14440 __input: &[u8],
14441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14442 let avail_len = __input.len();
14443 let mut payload_buf = [0; Self::ENCODED_LEN];
14444 let mut buf = if avail_len < Self::ENCODED_LEN {
14445 payload_buf[0..avail_len].copy_from_slice(__input);
14446 Bytes::new(&payload_buf)
14447 } else {
14448 Bytes::new(__input)
14449 };
14450 let mut __struct = Self::default();
14451 __struct.time_usec = buf.get_u64_le();
14452 __struct.time_week_ms = buf.get_u32_le();
14453 __struct.lat = buf.get_i32_le();
14454 __struct.lon = buf.get_i32_le();
14455 __struct.alt = buf.get_f32_le();
14456 __struct.hdop = buf.get_f32_le();
14457 __struct.vdop = buf.get_f32_le();
14458 __struct.vn = buf.get_f32_le();
14459 __struct.ve = buf.get_f32_le();
14460 __struct.vd = buf.get_f32_le();
14461 __struct.speed_accuracy = buf.get_f32_le();
14462 __struct.horiz_accuracy = buf.get_f32_le();
14463 __struct.vert_accuracy = buf.get_f32_le();
14464 let tmp = buf.get_u16_le();
14465 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14466 tmp & GpsInputIgnoreFlags::all().bits(),
14467 )
14468 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14469 flag_type: "GpsInputIgnoreFlags",
14470 value: tmp as u32,
14471 })?;
14472 __struct.time_week = buf.get_u16_le();
14473 __struct.gps_id = buf.get_u8();
14474 __struct.fix_type = buf.get_u8();
14475 __struct.satellites_visible = buf.get_u8();
14476 __struct.yaw = buf.get_u16_le();
14477 Ok(__struct)
14478 }
14479 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14480 let mut __tmp = BytesMut::new(bytes);
14481 #[allow(clippy::absurd_extreme_comparisons)]
14482 #[allow(unused_comparisons)]
14483 if __tmp.remaining() < Self::ENCODED_LEN {
14484 panic!(
14485 "buffer is too small (need {} bytes, but got {})",
14486 Self::ENCODED_LEN,
14487 __tmp.remaining(),
14488 )
14489 }
14490 __tmp.put_u64_le(self.time_usec);
14491 __tmp.put_u32_le(self.time_week_ms);
14492 __tmp.put_i32_le(self.lat);
14493 __tmp.put_i32_le(self.lon);
14494 __tmp.put_f32_le(self.alt);
14495 __tmp.put_f32_le(self.hdop);
14496 __tmp.put_f32_le(self.vdop);
14497 __tmp.put_f32_le(self.vn);
14498 __tmp.put_f32_le(self.ve);
14499 __tmp.put_f32_le(self.vd);
14500 __tmp.put_f32_le(self.speed_accuracy);
14501 __tmp.put_f32_le(self.horiz_accuracy);
14502 __tmp.put_f32_le(self.vert_accuracy);
14503 __tmp.put_u16_le(self.ignore_flags.bits());
14504 __tmp.put_u16_le(self.time_week);
14505 __tmp.put_u8(self.gps_id);
14506 __tmp.put_u8(self.fix_type);
14507 __tmp.put_u8(self.satellites_visible);
14508 if matches!(version, MavlinkVersion::V2) {
14509 __tmp.put_u16_le(self.yaw);
14510 let len = __tmp.len();
14511 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14512 } else {
14513 __tmp.len()
14514 }
14515 }
14516}
14517#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14518#[doc = ""]
14519#[doc = "ID: 24"]
14520#[derive(Debug, Clone, PartialEq)]
14521#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14523#[cfg_attr(feature = "ts", derive(TS))]
14524#[cfg_attr(feature = "ts", ts(export))]
14525pub struct GPS_RAW_INT_DATA {
14526 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14527 pub time_usec: u64,
14528 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14529 pub lat: i32,
14530 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14531 pub lon: i32,
14532 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14533 pub alt: i32,
14534 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14535 pub eph: u16,
14536 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14537 pub epv: u16,
14538 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14539 pub vel: u16,
14540 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14541 pub cog: u16,
14542 #[doc = "GPS fix type."]
14543 pub fix_type: GpsFixType,
14544 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14545 pub satellites_visible: u8,
14546 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14547 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14548 pub alt_ellipsoid: i32,
14549 #[doc = "Position uncertainty."]
14550 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14551 pub h_acc: u32,
14552 #[doc = "Altitude uncertainty."]
14553 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14554 pub v_acc: u32,
14555 #[doc = "Speed uncertainty."]
14556 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14557 pub vel_acc: u32,
14558 #[doc = "Heading / track uncertainty"]
14559 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14560 pub hdg_acc: u32,
14561 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14562 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14563 pub yaw: u16,
14564}
14565impl GPS_RAW_INT_DATA {
14566 pub const ENCODED_LEN: usize = 52usize;
14567 pub const DEFAULT: Self = Self {
14568 time_usec: 0_u64,
14569 lat: 0_i32,
14570 lon: 0_i32,
14571 alt: 0_i32,
14572 eph: 0_u16,
14573 epv: 0_u16,
14574 vel: 0_u16,
14575 cog: 0_u16,
14576 fix_type: GpsFixType::DEFAULT,
14577 satellites_visible: 0_u8,
14578 alt_ellipsoid: 0_i32,
14579 h_acc: 0_u32,
14580 v_acc: 0_u32,
14581 vel_acc: 0_u32,
14582 hdg_acc: 0_u32,
14583 yaw: 0_u16,
14584 };
14585 #[cfg(feature = "arbitrary")]
14586 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14587 use arbitrary::{Arbitrary, Unstructured};
14588 let mut buf = [0u8; 1024];
14589 rng.fill_bytes(&mut buf);
14590 let mut unstructured = Unstructured::new(&buf);
14591 Self::arbitrary(&mut unstructured).unwrap_or_default()
14592 }
14593}
14594impl Default for GPS_RAW_INT_DATA {
14595 fn default() -> Self {
14596 Self::DEFAULT.clone()
14597 }
14598}
14599impl MessageData for GPS_RAW_INT_DATA {
14600 type Message = MavMessage;
14601 const ID: u32 = 24u32;
14602 const NAME: &'static str = "GPS_RAW_INT";
14603 const EXTRA_CRC: u8 = 24u8;
14604 const ENCODED_LEN: usize = 52usize;
14605 fn deser(
14606 _version: MavlinkVersion,
14607 __input: &[u8],
14608 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14609 let avail_len = __input.len();
14610 let mut payload_buf = [0; Self::ENCODED_LEN];
14611 let mut buf = if avail_len < Self::ENCODED_LEN {
14612 payload_buf[0..avail_len].copy_from_slice(__input);
14613 Bytes::new(&payload_buf)
14614 } else {
14615 Bytes::new(__input)
14616 };
14617 let mut __struct = Self::default();
14618 __struct.time_usec = buf.get_u64_le();
14619 __struct.lat = buf.get_i32_le();
14620 __struct.lon = buf.get_i32_le();
14621 __struct.alt = buf.get_i32_le();
14622 __struct.eph = buf.get_u16_le();
14623 __struct.epv = buf.get_u16_le();
14624 __struct.vel = buf.get_u16_le();
14625 __struct.cog = buf.get_u16_le();
14626 let tmp = buf.get_u8();
14627 __struct.fix_type =
14628 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14629 enum_type: "GpsFixType",
14630 value: tmp as u32,
14631 })?;
14632 __struct.satellites_visible = buf.get_u8();
14633 __struct.alt_ellipsoid = buf.get_i32_le();
14634 __struct.h_acc = buf.get_u32_le();
14635 __struct.v_acc = buf.get_u32_le();
14636 __struct.vel_acc = buf.get_u32_le();
14637 __struct.hdg_acc = buf.get_u32_le();
14638 __struct.yaw = buf.get_u16_le();
14639 Ok(__struct)
14640 }
14641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14642 let mut __tmp = BytesMut::new(bytes);
14643 #[allow(clippy::absurd_extreme_comparisons)]
14644 #[allow(unused_comparisons)]
14645 if __tmp.remaining() < Self::ENCODED_LEN {
14646 panic!(
14647 "buffer is too small (need {} bytes, but got {})",
14648 Self::ENCODED_LEN,
14649 __tmp.remaining(),
14650 )
14651 }
14652 __tmp.put_u64_le(self.time_usec);
14653 __tmp.put_i32_le(self.lat);
14654 __tmp.put_i32_le(self.lon);
14655 __tmp.put_i32_le(self.alt);
14656 __tmp.put_u16_le(self.eph);
14657 __tmp.put_u16_le(self.epv);
14658 __tmp.put_u16_le(self.vel);
14659 __tmp.put_u16_le(self.cog);
14660 __tmp.put_u8(self.fix_type as u8);
14661 __tmp.put_u8(self.satellites_visible);
14662 if matches!(version, MavlinkVersion::V2) {
14663 __tmp.put_i32_le(self.alt_ellipsoid);
14664 __tmp.put_u32_le(self.h_acc);
14665 __tmp.put_u32_le(self.v_acc);
14666 __tmp.put_u32_le(self.vel_acc);
14667 __tmp.put_u32_le(self.hdg_acc);
14668 __tmp.put_u16_le(self.yaw);
14669 let len = __tmp.len();
14670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14671 } else {
14672 __tmp.len()
14673 }
14674 }
14675}
14676#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14677#[doc = ""]
14678#[doc = "ID: 233"]
14679#[derive(Debug, Clone, PartialEq)]
14680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14682#[cfg_attr(feature = "ts", derive(TS))]
14683#[cfg_attr(feature = "ts", ts(export))]
14684pub struct GPS_RTCM_DATA_DATA {
14685 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14686 pub flags: u8,
14687 #[doc = "data length"]
14688 pub len: u8,
14689 #[doc = "RTCM message (may be fragmented)"]
14690 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14691 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14692 pub data: [u8; 180],
14693}
14694impl GPS_RTCM_DATA_DATA {
14695 pub const ENCODED_LEN: usize = 182usize;
14696 pub const DEFAULT: Self = Self {
14697 flags: 0_u8,
14698 len: 0_u8,
14699 data: [0_u8; 180usize],
14700 };
14701 #[cfg(feature = "arbitrary")]
14702 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14703 use arbitrary::{Arbitrary, Unstructured};
14704 let mut buf = [0u8; 1024];
14705 rng.fill_bytes(&mut buf);
14706 let mut unstructured = Unstructured::new(&buf);
14707 Self::arbitrary(&mut unstructured).unwrap_or_default()
14708 }
14709}
14710impl Default for GPS_RTCM_DATA_DATA {
14711 fn default() -> Self {
14712 Self::DEFAULT.clone()
14713 }
14714}
14715impl MessageData for GPS_RTCM_DATA_DATA {
14716 type Message = MavMessage;
14717 const ID: u32 = 233u32;
14718 const NAME: &'static str = "GPS_RTCM_DATA";
14719 const EXTRA_CRC: u8 = 35u8;
14720 const ENCODED_LEN: usize = 182usize;
14721 fn deser(
14722 _version: MavlinkVersion,
14723 __input: &[u8],
14724 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14725 let avail_len = __input.len();
14726 let mut payload_buf = [0; Self::ENCODED_LEN];
14727 let mut buf = if avail_len < Self::ENCODED_LEN {
14728 payload_buf[0..avail_len].copy_from_slice(__input);
14729 Bytes::new(&payload_buf)
14730 } else {
14731 Bytes::new(__input)
14732 };
14733 let mut __struct = Self::default();
14734 __struct.flags = buf.get_u8();
14735 __struct.len = buf.get_u8();
14736 for v in &mut __struct.data {
14737 let val = buf.get_u8();
14738 *v = val;
14739 }
14740 Ok(__struct)
14741 }
14742 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14743 let mut __tmp = BytesMut::new(bytes);
14744 #[allow(clippy::absurd_extreme_comparisons)]
14745 #[allow(unused_comparisons)]
14746 if __tmp.remaining() < Self::ENCODED_LEN {
14747 panic!(
14748 "buffer is too small (need {} bytes, but got {})",
14749 Self::ENCODED_LEN,
14750 __tmp.remaining(),
14751 )
14752 }
14753 __tmp.put_u8(self.flags);
14754 __tmp.put_u8(self.len);
14755 for val in &self.data {
14756 __tmp.put_u8(*val);
14757 }
14758 if matches!(version, MavlinkVersion::V2) {
14759 let len = __tmp.len();
14760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14761 } else {
14762 __tmp.len()
14763 }
14764 }
14765}
14766#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14767#[doc = ""]
14768#[doc = "ID: 127"]
14769#[derive(Debug, Clone, PartialEq)]
14770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14772#[cfg_attr(feature = "ts", derive(TS))]
14773#[cfg_attr(feature = "ts", ts(export))]
14774pub struct GPS_RTK_DATA {
14775 #[doc = "Time since boot of last baseline message received."]
14776 pub time_last_baseline_ms: u32,
14777 #[doc = "GPS Time of Week of last baseline"]
14778 pub tow: u32,
14779 #[doc = "Current baseline in ECEF x or NED north component."]
14780 pub baseline_a_mm: i32,
14781 #[doc = "Current baseline in ECEF y or NED east component."]
14782 pub baseline_b_mm: i32,
14783 #[doc = "Current baseline in ECEF z or NED down component."]
14784 pub baseline_c_mm: i32,
14785 #[doc = "Current estimate of baseline accuracy."]
14786 pub accuracy: u32,
14787 #[doc = "Current number of integer ambiguity hypotheses."]
14788 pub iar_num_hypotheses: i32,
14789 #[doc = "GPS Week Number of last baseline"]
14790 pub wn: u16,
14791 #[doc = "Identification of connected RTK receiver."]
14792 pub rtk_receiver_id: u8,
14793 #[doc = "GPS-specific health report for RTK data."]
14794 pub rtk_health: u8,
14795 #[doc = "Rate of baseline messages being received by GPS"]
14796 pub rtk_rate: u8,
14797 #[doc = "Current number of sats used for RTK calculation."]
14798 pub nsats: u8,
14799 #[doc = "Coordinate system of baseline"]
14800 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14801}
14802impl GPS_RTK_DATA {
14803 pub const ENCODED_LEN: usize = 35usize;
14804 pub const DEFAULT: Self = Self {
14805 time_last_baseline_ms: 0_u32,
14806 tow: 0_u32,
14807 baseline_a_mm: 0_i32,
14808 baseline_b_mm: 0_i32,
14809 baseline_c_mm: 0_i32,
14810 accuracy: 0_u32,
14811 iar_num_hypotheses: 0_i32,
14812 wn: 0_u16,
14813 rtk_receiver_id: 0_u8,
14814 rtk_health: 0_u8,
14815 rtk_rate: 0_u8,
14816 nsats: 0_u8,
14817 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14818 };
14819 #[cfg(feature = "arbitrary")]
14820 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14821 use arbitrary::{Arbitrary, Unstructured};
14822 let mut buf = [0u8; 1024];
14823 rng.fill_bytes(&mut buf);
14824 let mut unstructured = Unstructured::new(&buf);
14825 Self::arbitrary(&mut unstructured).unwrap_or_default()
14826 }
14827}
14828impl Default for GPS_RTK_DATA {
14829 fn default() -> Self {
14830 Self::DEFAULT.clone()
14831 }
14832}
14833impl MessageData for GPS_RTK_DATA {
14834 type Message = MavMessage;
14835 const ID: u32 = 127u32;
14836 const NAME: &'static str = "GPS_RTK";
14837 const EXTRA_CRC: u8 = 25u8;
14838 const ENCODED_LEN: usize = 35usize;
14839 fn deser(
14840 _version: MavlinkVersion,
14841 __input: &[u8],
14842 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14843 let avail_len = __input.len();
14844 let mut payload_buf = [0; Self::ENCODED_LEN];
14845 let mut buf = if avail_len < Self::ENCODED_LEN {
14846 payload_buf[0..avail_len].copy_from_slice(__input);
14847 Bytes::new(&payload_buf)
14848 } else {
14849 Bytes::new(__input)
14850 };
14851 let mut __struct = Self::default();
14852 __struct.time_last_baseline_ms = buf.get_u32_le();
14853 __struct.tow = buf.get_u32_le();
14854 __struct.baseline_a_mm = buf.get_i32_le();
14855 __struct.baseline_b_mm = buf.get_i32_le();
14856 __struct.baseline_c_mm = buf.get_i32_le();
14857 __struct.accuracy = buf.get_u32_le();
14858 __struct.iar_num_hypotheses = buf.get_i32_le();
14859 __struct.wn = buf.get_u16_le();
14860 __struct.rtk_receiver_id = buf.get_u8();
14861 __struct.rtk_health = buf.get_u8();
14862 __struct.rtk_rate = buf.get_u8();
14863 __struct.nsats = buf.get_u8();
14864 let tmp = buf.get_u8();
14865 __struct.baseline_coords_type =
14866 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14867 enum_type: "RtkBaselineCoordinateSystem",
14868 value: tmp as u32,
14869 })?;
14870 Ok(__struct)
14871 }
14872 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14873 let mut __tmp = BytesMut::new(bytes);
14874 #[allow(clippy::absurd_extreme_comparisons)]
14875 #[allow(unused_comparisons)]
14876 if __tmp.remaining() < Self::ENCODED_LEN {
14877 panic!(
14878 "buffer is too small (need {} bytes, but got {})",
14879 Self::ENCODED_LEN,
14880 __tmp.remaining(),
14881 )
14882 }
14883 __tmp.put_u32_le(self.time_last_baseline_ms);
14884 __tmp.put_u32_le(self.tow);
14885 __tmp.put_i32_le(self.baseline_a_mm);
14886 __tmp.put_i32_le(self.baseline_b_mm);
14887 __tmp.put_i32_le(self.baseline_c_mm);
14888 __tmp.put_u32_le(self.accuracy);
14889 __tmp.put_i32_le(self.iar_num_hypotheses);
14890 __tmp.put_u16_le(self.wn);
14891 __tmp.put_u8(self.rtk_receiver_id);
14892 __tmp.put_u8(self.rtk_health);
14893 __tmp.put_u8(self.rtk_rate);
14894 __tmp.put_u8(self.nsats);
14895 __tmp.put_u8(self.baseline_coords_type as u8);
14896 if matches!(version, MavlinkVersion::V2) {
14897 let len = __tmp.len();
14898 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14899 } else {
14900 __tmp.len()
14901 }
14902 }
14903}
14904#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14905#[doc = ""]
14906#[doc = "ID: 25"]
14907#[derive(Debug, Clone, PartialEq)]
14908#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14909#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14910#[cfg_attr(feature = "ts", derive(TS))]
14911#[cfg_attr(feature = "ts", ts(export))]
14912pub struct GPS_STATUS_DATA {
14913 #[doc = "Number of satellites visible"]
14914 pub satellites_visible: u8,
14915 #[doc = "Global satellite ID"]
14916 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14917 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14918 pub satellite_prn: [u8; 20],
14919 #[doc = "0: Satellite not used, 1: used for localization"]
14920 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14921 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14922 pub satellite_used: [u8; 20],
14923 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14924 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14925 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14926 pub satellite_elevation: [u8; 20],
14927 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14928 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14929 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14930 pub satellite_azimuth: [u8; 20],
14931 #[doc = "Signal to noise ratio of satellite"]
14932 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14933 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14934 pub satellite_snr: [u8; 20],
14935}
14936impl GPS_STATUS_DATA {
14937 pub const ENCODED_LEN: usize = 101usize;
14938 pub const DEFAULT: Self = Self {
14939 satellites_visible: 0_u8,
14940 satellite_prn: [0_u8; 20usize],
14941 satellite_used: [0_u8; 20usize],
14942 satellite_elevation: [0_u8; 20usize],
14943 satellite_azimuth: [0_u8; 20usize],
14944 satellite_snr: [0_u8; 20usize],
14945 };
14946 #[cfg(feature = "arbitrary")]
14947 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14948 use arbitrary::{Arbitrary, Unstructured};
14949 let mut buf = [0u8; 1024];
14950 rng.fill_bytes(&mut buf);
14951 let mut unstructured = Unstructured::new(&buf);
14952 Self::arbitrary(&mut unstructured).unwrap_or_default()
14953 }
14954}
14955impl Default for GPS_STATUS_DATA {
14956 fn default() -> Self {
14957 Self::DEFAULT.clone()
14958 }
14959}
14960impl MessageData for GPS_STATUS_DATA {
14961 type Message = MavMessage;
14962 const ID: u32 = 25u32;
14963 const NAME: &'static str = "GPS_STATUS";
14964 const EXTRA_CRC: u8 = 23u8;
14965 const ENCODED_LEN: usize = 101usize;
14966 fn deser(
14967 _version: MavlinkVersion,
14968 __input: &[u8],
14969 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14970 let avail_len = __input.len();
14971 let mut payload_buf = [0; Self::ENCODED_LEN];
14972 let mut buf = if avail_len < Self::ENCODED_LEN {
14973 payload_buf[0..avail_len].copy_from_slice(__input);
14974 Bytes::new(&payload_buf)
14975 } else {
14976 Bytes::new(__input)
14977 };
14978 let mut __struct = Self::default();
14979 __struct.satellites_visible = buf.get_u8();
14980 for v in &mut __struct.satellite_prn {
14981 let val = buf.get_u8();
14982 *v = val;
14983 }
14984 for v in &mut __struct.satellite_used {
14985 let val = buf.get_u8();
14986 *v = val;
14987 }
14988 for v in &mut __struct.satellite_elevation {
14989 let val = buf.get_u8();
14990 *v = val;
14991 }
14992 for v in &mut __struct.satellite_azimuth {
14993 let val = buf.get_u8();
14994 *v = val;
14995 }
14996 for v in &mut __struct.satellite_snr {
14997 let val = buf.get_u8();
14998 *v = val;
14999 }
15000 Ok(__struct)
15001 }
15002 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15003 let mut __tmp = BytesMut::new(bytes);
15004 #[allow(clippy::absurd_extreme_comparisons)]
15005 #[allow(unused_comparisons)]
15006 if __tmp.remaining() < Self::ENCODED_LEN {
15007 panic!(
15008 "buffer is too small (need {} bytes, but got {})",
15009 Self::ENCODED_LEN,
15010 __tmp.remaining(),
15011 )
15012 }
15013 __tmp.put_u8(self.satellites_visible);
15014 for val in &self.satellite_prn {
15015 __tmp.put_u8(*val);
15016 }
15017 for val in &self.satellite_used {
15018 __tmp.put_u8(*val);
15019 }
15020 for val in &self.satellite_elevation {
15021 __tmp.put_u8(*val);
15022 }
15023 for val in &self.satellite_azimuth {
15024 __tmp.put_u8(*val);
15025 }
15026 for val in &self.satellite_snr {
15027 __tmp.put_u8(*val);
15028 }
15029 if matches!(version, MavlinkVersion::V2) {
15030 let len = __tmp.len();
15031 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15032 } else {
15033 __tmp.len()
15034 }
15035 }
15036}
15037#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15038#[doc = ""]
15039#[doc = "ID: 0"]
15040#[derive(Debug, Clone, PartialEq)]
15041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15043#[cfg_attr(feature = "ts", derive(TS))]
15044#[cfg_attr(feature = "ts", ts(export))]
15045pub struct HEARTBEAT_DATA {
15046 #[doc = "A bitfield for use for autopilot-specific flags"]
15047 pub custom_mode: u32,
15048 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15049 pub mavtype: MavType,
15050 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15051 pub autopilot: MavAutopilot,
15052 #[doc = "System mode bitmap."]
15053 pub base_mode: MavModeFlag,
15054 #[doc = "System status flag."]
15055 pub system_status: MavState,
15056 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15057 pub mavlink_version: u8,
15058}
15059impl HEARTBEAT_DATA {
15060 pub const ENCODED_LEN: usize = 9usize;
15061 pub const DEFAULT: Self = Self {
15062 custom_mode: 0_u32,
15063 mavtype: MavType::DEFAULT,
15064 autopilot: MavAutopilot::DEFAULT,
15065 base_mode: MavModeFlag::DEFAULT,
15066 system_status: MavState::DEFAULT,
15067 mavlink_version: MINOR_MAVLINK_VERSION,
15068 };
15069 #[cfg(feature = "arbitrary")]
15070 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15071 use arbitrary::{Arbitrary, Unstructured};
15072 let mut buf = [0u8; 1024];
15073 rng.fill_bytes(&mut buf);
15074 let mut unstructured = Unstructured::new(&buf);
15075 Self::arbitrary(&mut unstructured).unwrap_or_default()
15076 }
15077}
15078impl Default for HEARTBEAT_DATA {
15079 fn default() -> Self {
15080 Self::DEFAULT.clone()
15081 }
15082}
15083impl MessageData for HEARTBEAT_DATA {
15084 type Message = MavMessage;
15085 const ID: u32 = 0u32;
15086 const NAME: &'static str = "HEARTBEAT";
15087 const EXTRA_CRC: u8 = 50u8;
15088 const ENCODED_LEN: usize = 9usize;
15089 fn deser(
15090 _version: MavlinkVersion,
15091 __input: &[u8],
15092 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15093 let avail_len = __input.len();
15094 let mut payload_buf = [0; Self::ENCODED_LEN];
15095 let mut buf = if avail_len < Self::ENCODED_LEN {
15096 payload_buf[0..avail_len].copy_from_slice(__input);
15097 Bytes::new(&payload_buf)
15098 } else {
15099 Bytes::new(__input)
15100 };
15101 let mut __struct = Self::default();
15102 __struct.custom_mode = buf.get_u32_le();
15103 let tmp = buf.get_u8();
15104 __struct.mavtype =
15105 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15106 enum_type: "MavType",
15107 value: tmp as u32,
15108 })?;
15109 let tmp = buf.get_u8();
15110 __struct.autopilot =
15111 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15112 enum_type: "MavAutopilot",
15113 value: tmp as u32,
15114 })?;
15115 let tmp = buf.get_u8();
15116 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15117 ::mavlink_core::error::ParserError::InvalidFlag {
15118 flag_type: "MavModeFlag",
15119 value: tmp as u32,
15120 },
15121 )?;
15122 let tmp = buf.get_u8();
15123 __struct.system_status =
15124 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15125 enum_type: "MavState",
15126 value: tmp as u32,
15127 })?;
15128 __struct.mavlink_version = buf.get_u8();
15129 Ok(__struct)
15130 }
15131 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15132 let mut __tmp = BytesMut::new(bytes);
15133 #[allow(clippy::absurd_extreme_comparisons)]
15134 #[allow(unused_comparisons)]
15135 if __tmp.remaining() < Self::ENCODED_LEN {
15136 panic!(
15137 "buffer is too small (need {} bytes, but got {})",
15138 Self::ENCODED_LEN,
15139 __tmp.remaining(),
15140 )
15141 }
15142 __tmp.put_u32_le(self.custom_mode);
15143 __tmp.put_u8(self.mavtype as u8);
15144 __tmp.put_u8(self.autopilot as u8);
15145 __tmp.put_u8(self.base_mode.bits());
15146 __tmp.put_u8(self.system_status as u8);
15147 __tmp.put_u8(self.mavlink_version);
15148 if matches!(version, MavlinkVersion::V2) {
15149 let len = __tmp.len();
15150 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15151 } else {
15152 __tmp.len()
15153 }
15154 }
15155}
15156#[doc = "Herelink Telemetry."]
15157#[doc = ""]
15158#[doc = "ID: 50003"]
15159#[derive(Debug, Clone, PartialEq)]
15160#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15161#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15162#[cfg_attr(feature = "ts", derive(TS))]
15163#[cfg_attr(feature = "ts", ts(export))]
15164pub struct HERELINK_TELEM_DATA {
15165 pub rf_freq: u32,
15166 pub link_bw: u32,
15167 pub link_rate: u32,
15168 pub snr: i16,
15169 pub cpu_temp: i16,
15170 pub board_temp: i16,
15171 pub rssi: u8,
15172}
15173impl HERELINK_TELEM_DATA {
15174 pub const ENCODED_LEN: usize = 19usize;
15175 pub const DEFAULT: Self = Self {
15176 rf_freq: 0_u32,
15177 link_bw: 0_u32,
15178 link_rate: 0_u32,
15179 snr: 0_i16,
15180 cpu_temp: 0_i16,
15181 board_temp: 0_i16,
15182 rssi: 0_u8,
15183 };
15184 #[cfg(feature = "arbitrary")]
15185 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15186 use arbitrary::{Arbitrary, Unstructured};
15187 let mut buf = [0u8; 1024];
15188 rng.fill_bytes(&mut buf);
15189 let mut unstructured = Unstructured::new(&buf);
15190 Self::arbitrary(&mut unstructured).unwrap_or_default()
15191 }
15192}
15193impl Default for HERELINK_TELEM_DATA {
15194 fn default() -> Self {
15195 Self::DEFAULT.clone()
15196 }
15197}
15198impl MessageData for HERELINK_TELEM_DATA {
15199 type Message = MavMessage;
15200 const ID: u32 = 50003u32;
15201 const NAME: &'static str = "HERELINK_TELEM";
15202 const EXTRA_CRC: u8 = 62u8;
15203 const ENCODED_LEN: usize = 19usize;
15204 fn deser(
15205 _version: MavlinkVersion,
15206 __input: &[u8],
15207 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15208 let avail_len = __input.len();
15209 let mut payload_buf = [0; Self::ENCODED_LEN];
15210 let mut buf = if avail_len < Self::ENCODED_LEN {
15211 payload_buf[0..avail_len].copy_from_slice(__input);
15212 Bytes::new(&payload_buf)
15213 } else {
15214 Bytes::new(__input)
15215 };
15216 let mut __struct = Self::default();
15217 __struct.rf_freq = buf.get_u32_le();
15218 __struct.link_bw = buf.get_u32_le();
15219 __struct.link_rate = buf.get_u32_le();
15220 __struct.snr = buf.get_i16_le();
15221 __struct.cpu_temp = buf.get_i16_le();
15222 __struct.board_temp = buf.get_i16_le();
15223 __struct.rssi = buf.get_u8();
15224 Ok(__struct)
15225 }
15226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15227 let mut __tmp = BytesMut::new(bytes);
15228 #[allow(clippy::absurd_extreme_comparisons)]
15229 #[allow(unused_comparisons)]
15230 if __tmp.remaining() < Self::ENCODED_LEN {
15231 panic!(
15232 "buffer is too small (need {} bytes, but got {})",
15233 Self::ENCODED_LEN,
15234 __tmp.remaining(),
15235 )
15236 }
15237 __tmp.put_u32_le(self.rf_freq);
15238 __tmp.put_u32_le(self.link_bw);
15239 __tmp.put_u32_le(self.link_rate);
15240 __tmp.put_i16_le(self.snr);
15241 __tmp.put_i16_le(self.cpu_temp);
15242 __tmp.put_i16_le(self.board_temp);
15243 __tmp.put_u8(self.rssi);
15244 if matches!(version, MavlinkVersion::V2) {
15245 let len = __tmp.len();
15246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15247 } else {
15248 __tmp.len()
15249 }
15250 }
15251}
15252#[doc = "Information about video stream."]
15253#[doc = ""]
15254#[doc = "ID: 50002"]
15255#[derive(Debug, Clone, PartialEq)]
15256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15258#[cfg_attr(feature = "ts", derive(TS))]
15259#[cfg_attr(feature = "ts", ts(export))]
15260pub struct HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15261 #[doc = "Frame rate."]
15262 pub framerate: f32,
15263 #[doc = "Bit rate."]
15264 pub bitrate: u32,
15265 #[doc = "Horizontal resolution."]
15266 pub resolution_h: u16,
15267 #[doc = "Vertical resolution."]
15268 pub resolution_v: u16,
15269 #[doc = "Video image rotation clockwise."]
15270 pub rotation: u16,
15271 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
15272 pub camera_id: u8,
15273 #[doc = "Number of streams available."]
15274 pub status: u8,
15275 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
15276 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15277 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15278 pub uri: [u8; 230],
15279}
15280impl HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15281 pub const ENCODED_LEN: usize = 246usize;
15282 pub const DEFAULT: Self = Self {
15283 framerate: 0.0_f32,
15284 bitrate: 0_u32,
15285 resolution_h: 0_u16,
15286 resolution_v: 0_u16,
15287 rotation: 0_u16,
15288 camera_id: 0_u8,
15289 status: 0_u8,
15290 uri: [0_u8; 230usize],
15291 };
15292 #[cfg(feature = "arbitrary")]
15293 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15294 use arbitrary::{Arbitrary, Unstructured};
15295 let mut buf = [0u8; 1024];
15296 rng.fill_bytes(&mut buf);
15297 let mut unstructured = Unstructured::new(&buf);
15298 Self::arbitrary(&mut unstructured).unwrap_or_default()
15299 }
15300}
15301impl Default for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15302 fn default() -> Self {
15303 Self::DEFAULT.clone()
15304 }
15305}
15306impl MessageData for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
15307 type Message = MavMessage;
15308 const ID: u32 = 50002u32;
15309 const NAME: &'static str = "HERELINK_VIDEO_STREAM_INFORMATION";
15310 const EXTRA_CRC: u8 = 181u8;
15311 const ENCODED_LEN: usize = 246usize;
15312 fn deser(
15313 _version: MavlinkVersion,
15314 __input: &[u8],
15315 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15316 let avail_len = __input.len();
15317 let mut payload_buf = [0; Self::ENCODED_LEN];
15318 let mut buf = if avail_len < Self::ENCODED_LEN {
15319 payload_buf[0..avail_len].copy_from_slice(__input);
15320 Bytes::new(&payload_buf)
15321 } else {
15322 Bytes::new(__input)
15323 };
15324 let mut __struct = Self::default();
15325 __struct.framerate = buf.get_f32_le();
15326 __struct.bitrate = buf.get_u32_le();
15327 __struct.resolution_h = buf.get_u16_le();
15328 __struct.resolution_v = buf.get_u16_le();
15329 __struct.rotation = buf.get_u16_le();
15330 __struct.camera_id = buf.get_u8();
15331 __struct.status = buf.get_u8();
15332 for v in &mut __struct.uri {
15333 let val = buf.get_u8();
15334 *v = val;
15335 }
15336 Ok(__struct)
15337 }
15338 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15339 let mut __tmp = BytesMut::new(bytes);
15340 #[allow(clippy::absurd_extreme_comparisons)]
15341 #[allow(unused_comparisons)]
15342 if __tmp.remaining() < Self::ENCODED_LEN {
15343 panic!(
15344 "buffer is too small (need {} bytes, but got {})",
15345 Self::ENCODED_LEN,
15346 __tmp.remaining(),
15347 )
15348 }
15349 __tmp.put_f32_le(self.framerate);
15350 __tmp.put_u32_le(self.bitrate);
15351 __tmp.put_u16_le(self.resolution_h);
15352 __tmp.put_u16_le(self.resolution_v);
15353 __tmp.put_u16_le(self.rotation);
15354 __tmp.put_u8(self.camera_id);
15355 __tmp.put_u8(self.status);
15356 for val in &self.uri {
15357 __tmp.put_u8(*val);
15358 }
15359 if matches!(version, MavlinkVersion::V2) {
15360 let len = __tmp.len();
15361 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15362 } else {
15363 __tmp.len()
15364 }
15365 }
15366}
15367#[doc = "The IMU readings in SI units in NED body frame."]
15368#[doc = ""]
15369#[doc = "ID: 105"]
15370#[derive(Debug, Clone, PartialEq)]
15371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15373#[cfg_attr(feature = "ts", derive(TS))]
15374#[cfg_attr(feature = "ts", ts(export))]
15375pub struct HIGHRES_IMU_DATA {
15376 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15377 pub time_usec: u64,
15378 #[doc = "X acceleration"]
15379 pub xacc: f32,
15380 #[doc = "Y acceleration"]
15381 pub yacc: f32,
15382 #[doc = "Z acceleration"]
15383 pub zacc: f32,
15384 #[doc = "Angular speed around X axis"]
15385 pub xgyro: f32,
15386 #[doc = "Angular speed around Y axis"]
15387 pub ygyro: f32,
15388 #[doc = "Angular speed around Z axis"]
15389 pub zgyro: f32,
15390 #[doc = "X Magnetic field"]
15391 pub xmag: f32,
15392 #[doc = "Y Magnetic field"]
15393 pub ymag: f32,
15394 #[doc = "Z Magnetic field"]
15395 pub zmag: f32,
15396 #[doc = "Absolute pressure"]
15397 pub abs_pressure: f32,
15398 #[doc = "Differential pressure"]
15399 pub diff_pressure: f32,
15400 #[doc = "Altitude calculated from pressure"]
15401 pub pressure_alt: f32,
15402 #[doc = "Temperature"]
15403 pub temperature: f32,
15404 #[doc = "Bitmap for fields that have updated since last message"]
15405 pub fields_updated: HighresImuUpdatedFlags,
15406 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15407 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15408 pub id: u8,
15409}
15410impl HIGHRES_IMU_DATA {
15411 pub const ENCODED_LEN: usize = 63usize;
15412 pub const DEFAULT: Self = Self {
15413 time_usec: 0_u64,
15414 xacc: 0.0_f32,
15415 yacc: 0.0_f32,
15416 zacc: 0.0_f32,
15417 xgyro: 0.0_f32,
15418 ygyro: 0.0_f32,
15419 zgyro: 0.0_f32,
15420 xmag: 0.0_f32,
15421 ymag: 0.0_f32,
15422 zmag: 0.0_f32,
15423 abs_pressure: 0.0_f32,
15424 diff_pressure: 0.0_f32,
15425 pressure_alt: 0.0_f32,
15426 temperature: 0.0_f32,
15427 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15428 id: 0_u8,
15429 };
15430 #[cfg(feature = "arbitrary")]
15431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15432 use arbitrary::{Arbitrary, Unstructured};
15433 let mut buf = [0u8; 1024];
15434 rng.fill_bytes(&mut buf);
15435 let mut unstructured = Unstructured::new(&buf);
15436 Self::arbitrary(&mut unstructured).unwrap_or_default()
15437 }
15438}
15439impl Default for HIGHRES_IMU_DATA {
15440 fn default() -> Self {
15441 Self::DEFAULT.clone()
15442 }
15443}
15444impl MessageData for HIGHRES_IMU_DATA {
15445 type Message = MavMessage;
15446 const ID: u32 = 105u32;
15447 const NAME: &'static str = "HIGHRES_IMU";
15448 const EXTRA_CRC: u8 = 93u8;
15449 const ENCODED_LEN: usize = 63usize;
15450 fn deser(
15451 _version: MavlinkVersion,
15452 __input: &[u8],
15453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15454 let avail_len = __input.len();
15455 let mut payload_buf = [0; Self::ENCODED_LEN];
15456 let mut buf = if avail_len < Self::ENCODED_LEN {
15457 payload_buf[0..avail_len].copy_from_slice(__input);
15458 Bytes::new(&payload_buf)
15459 } else {
15460 Bytes::new(__input)
15461 };
15462 let mut __struct = Self::default();
15463 __struct.time_usec = buf.get_u64_le();
15464 __struct.xacc = buf.get_f32_le();
15465 __struct.yacc = buf.get_f32_le();
15466 __struct.zacc = buf.get_f32_le();
15467 __struct.xgyro = buf.get_f32_le();
15468 __struct.ygyro = buf.get_f32_le();
15469 __struct.zgyro = buf.get_f32_le();
15470 __struct.xmag = buf.get_f32_le();
15471 __struct.ymag = buf.get_f32_le();
15472 __struct.zmag = buf.get_f32_le();
15473 __struct.abs_pressure = buf.get_f32_le();
15474 __struct.diff_pressure = buf.get_f32_le();
15475 __struct.pressure_alt = buf.get_f32_le();
15476 __struct.temperature = buf.get_f32_le();
15477 let tmp = buf.get_u16_le();
15478 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
15479 tmp & HighresImuUpdatedFlags::all().bits(),
15480 )
15481 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15482 flag_type: "HighresImuUpdatedFlags",
15483 value: tmp as u32,
15484 })?;
15485 __struct.id = buf.get_u8();
15486 Ok(__struct)
15487 }
15488 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15489 let mut __tmp = BytesMut::new(bytes);
15490 #[allow(clippy::absurd_extreme_comparisons)]
15491 #[allow(unused_comparisons)]
15492 if __tmp.remaining() < Self::ENCODED_LEN {
15493 panic!(
15494 "buffer is too small (need {} bytes, but got {})",
15495 Self::ENCODED_LEN,
15496 __tmp.remaining(),
15497 )
15498 }
15499 __tmp.put_u64_le(self.time_usec);
15500 __tmp.put_f32_le(self.xacc);
15501 __tmp.put_f32_le(self.yacc);
15502 __tmp.put_f32_le(self.zacc);
15503 __tmp.put_f32_le(self.xgyro);
15504 __tmp.put_f32_le(self.ygyro);
15505 __tmp.put_f32_le(self.zgyro);
15506 __tmp.put_f32_le(self.xmag);
15507 __tmp.put_f32_le(self.ymag);
15508 __tmp.put_f32_le(self.zmag);
15509 __tmp.put_f32_le(self.abs_pressure);
15510 __tmp.put_f32_le(self.diff_pressure);
15511 __tmp.put_f32_le(self.pressure_alt);
15512 __tmp.put_f32_le(self.temperature);
15513 __tmp.put_u16_le(self.fields_updated.bits());
15514 if matches!(version, MavlinkVersion::V2) {
15515 __tmp.put_u8(self.id);
15516 let len = __tmp.len();
15517 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15518 } else {
15519 __tmp.len()
15520 }
15521 }
15522}
15523#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15524#[doc = "Message appropriate for high latency connections like Iridium."]
15525#[doc = ""]
15526#[doc = "ID: 234"]
15527#[derive(Debug, Clone, PartialEq)]
15528#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15529#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15530#[cfg_attr(feature = "ts", derive(TS))]
15531#[cfg_attr(feature = "ts", ts(export))]
15532pub struct HIGH_LATENCY_DATA {
15533 #[doc = "A bitfield for use for autopilot-specific flags."]
15534 pub custom_mode: u32,
15535 #[doc = "Latitude"]
15536 pub latitude: i32,
15537 #[doc = "Longitude"]
15538 pub longitude: i32,
15539 #[doc = "roll"]
15540 pub roll: i16,
15541 #[doc = "pitch"]
15542 pub pitch: i16,
15543 #[doc = "heading"]
15544 pub heading: u16,
15545 #[doc = "heading setpoint"]
15546 pub heading_sp: i16,
15547 #[doc = "Altitude above mean sea level"]
15548 pub altitude_amsl: i16,
15549 #[doc = "Altitude setpoint relative to the home position"]
15550 pub altitude_sp: i16,
15551 #[doc = "distance to target"]
15552 pub wp_distance: u16,
15553 #[doc = "Bitmap of enabled system modes."]
15554 pub base_mode: MavModeFlag,
15555 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15556 pub landed_state: MavLandedState,
15557 #[doc = "throttle (percentage)"]
15558 pub throttle: i8,
15559 #[doc = "airspeed"]
15560 pub airspeed: u8,
15561 #[doc = "airspeed setpoint"]
15562 pub airspeed_sp: u8,
15563 #[doc = "groundspeed"]
15564 pub groundspeed: u8,
15565 #[doc = "climb rate"]
15566 pub climb_rate: i8,
15567 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15568 pub gps_nsat: u8,
15569 #[doc = "GPS Fix type."]
15570 pub gps_fix_type: GpsFixType,
15571 #[doc = "Remaining battery (percentage)"]
15572 pub battery_remaining: u8,
15573 #[doc = "Autopilot temperature (degrees C)"]
15574 pub temperature: i8,
15575 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15576 pub temperature_air: i8,
15577 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15578 pub failsafe: u8,
15579 #[doc = "current waypoint number"]
15580 pub wp_num: u8,
15581}
15582impl HIGH_LATENCY_DATA {
15583 pub const ENCODED_LEN: usize = 40usize;
15584 pub const DEFAULT: Self = Self {
15585 custom_mode: 0_u32,
15586 latitude: 0_i32,
15587 longitude: 0_i32,
15588 roll: 0_i16,
15589 pitch: 0_i16,
15590 heading: 0_u16,
15591 heading_sp: 0_i16,
15592 altitude_amsl: 0_i16,
15593 altitude_sp: 0_i16,
15594 wp_distance: 0_u16,
15595 base_mode: MavModeFlag::DEFAULT,
15596 landed_state: MavLandedState::DEFAULT,
15597 throttle: 0_i8,
15598 airspeed: 0_u8,
15599 airspeed_sp: 0_u8,
15600 groundspeed: 0_u8,
15601 climb_rate: 0_i8,
15602 gps_nsat: 0_u8,
15603 gps_fix_type: GpsFixType::DEFAULT,
15604 battery_remaining: 0_u8,
15605 temperature: 0_i8,
15606 temperature_air: 0_i8,
15607 failsafe: 0_u8,
15608 wp_num: 0_u8,
15609 };
15610 #[cfg(feature = "arbitrary")]
15611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15612 use arbitrary::{Arbitrary, Unstructured};
15613 let mut buf = [0u8; 1024];
15614 rng.fill_bytes(&mut buf);
15615 let mut unstructured = Unstructured::new(&buf);
15616 Self::arbitrary(&mut unstructured).unwrap_or_default()
15617 }
15618}
15619impl Default for HIGH_LATENCY_DATA {
15620 fn default() -> Self {
15621 Self::DEFAULT.clone()
15622 }
15623}
15624impl MessageData for HIGH_LATENCY_DATA {
15625 type Message = MavMessage;
15626 const ID: u32 = 234u32;
15627 const NAME: &'static str = "HIGH_LATENCY";
15628 const EXTRA_CRC: u8 = 150u8;
15629 const ENCODED_LEN: usize = 40usize;
15630 fn deser(
15631 _version: MavlinkVersion,
15632 __input: &[u8],
15633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15634 let avail_len = __input.len();
15635 let mut payload_buf = [0; Self::ENCODED_LEN];
15636 let mut buf = if avail_len < Self::ENCODED_LEN {
15637 payload_buf[0..avail_len].copy_from_slice(__input);
15638 Bytes::new(&payload_buf)
15639 } else {
15640 Bytes::new(__input)
15641 };
15642 let mut __struct = Self::default();
15643 __struct.custom_mode = buf.get_u32_le();
15644 __struct.latitude = buf.get_i32_le();
15645 __struct.longitude = buf.get_i32_le();
15646 __struct.roll = buf.get_i16_le();
15647 __struct.pitch = buf.get_i16_le();
15648 __struct.heading = buf.get_u16_le();
15649 __struct.heading_sp = buf.get_i16_le();
15650 __struct.altitude_amsl = buf.get_i16_le();
15651 __struct.altitude_sp = buf.get_i16_le();
15652 __struct.wp_distance = buf.get_u16_le();
15653 let tmp = buf.get_u8();
15654 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15655 ::mavlink_core::error::ParserError::InvalidFlag {
15656 flag_type: "MavModeFlag",
15657 value: tmp as u32,
15658 },
15659 )?;
15660 let tmp = buf.get_u8();
15661 __struct.landed_state =
15662 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15663 enum_type: "MavLandedState",
15664 value: tmp as u32,
15665 })?;
15666 __struct.throttle = buf.get_i8();
15667 __struct.airspeed = buf.get_u8();
15668 __struct.airspeed_sp = buf.get_u8();
15669 __struct.groundspeed = buf.get_u8();
15670 __struct.climb_rate = buf.get_i8();
15671 __struct.gps_nsat = buf.get_u8();
15672 let tmp = buf.get_u8();
15673 __struct.gps_fix_type =
15674 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15675 enum_type: "GpsFixType",
15676 value: tmp as u32,
15677 })?;
15678 __struct.battery_remaining = buf.get_u8();
15679 __struct.temperature = buf.get_i8();
15680 __struct.temperature_air = buf.get_i8();
15681 __struct.failsafe = buf.get_u8();
15682 __struct.wp_num = buf.get_u8();
15683 Ok(__struct)
15684 }
15685 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15686 let mut __tmp = BytesMut::new(bytes);
15687 #[allow(clippy::absurd_extreme_comparisons)]
15688 #[allow(unused_comparisons)]
15689 if __tmp.remaining() < Self::ENCODED_LEN {
15690 panic!(
15691 "buffer is too small (need {} bytes, but got {})",
15692 Self::ENCODED_LEN,
15693 __tmp.remaining(),
15694 )
15695 }
15696 __tmp.put_u32_le(self.custom_mode);
15697 __tmp.put_i32_le(self.latitude);
15698 __tmp.put_i32_le(self.longitude);
15699 __tmp.put_i16_le(self.roll);
15700 __tmp.put_i16_le(self.pitch);
15701 __tmp.put_u16_le(self.heading);
15702 __tmp.put_i16_le(self.heading_sp);
15703 __tmp.put_i16_le(self.altitude_amsl);
15704 __tmp.put_i16_le(self.altitude_sp);
15705 __tmp.put_u16_le(self.wp_distance);
15706 __tmp.put_u8(self.base_mode.bits());
15707 __tmp.put_u8(self.landed_state as u8);
15708 __tmp.put_i8(self.throttle);
15709 __tmp.put_u8(self.airspeed);
15710 __tmp.put_u8(self.airspeed_sp);
15711 __tmp.put_u8(self.groundspeed);
15712 __tmp.put_i8(self.climb_rate);
15713 __tmp.put_u8(self.gps_nsat);
15714 __tmp.put_u8(self.gps_fix_type as u8);
15715 __tmp.put_u8(self.battery_remaining);
15716 __tmp.put_i8(self.temperature);
15717 __tmp.put_i8(self.temperature_air);
15718 __tmp.put_u8(self.failsafe);
15719 __tmp.put_u8(self.wp_num);
15720 if matches!(version, MavlinkVersion::V2) {
15721 let len = __tmp.len();
15722 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15723 } else {
15724 __tmp.len()
15725 }
15726 }
15727}
15728#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15729#[doc = ""]
15730#[doc = "ID: 235"]
15731#[derive(Debug, Clone, PartialEq)]
15732#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15734#[cfg_attr(feature = "ts", derive(TS))]
15735#[cfg_attr(feature = "ts", ts(export))]
15736pub struct HIGH_LATENCY2_DATA {
15737 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15738 pub timestamp: u32,
15739 #[doc = "Latitude"]
15740 pub latitude: i32,
15741 #[doc = "Longitude"]
15742 pub longitude: i32,
15743 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15744 pub custom_mode: u16,
15745 #[doc = "Altitude above mean sea level"]
15746 pub altitude: i16,
15747 #[doc = "Altitude setpoint"]
15748 pub target_altitude: i16,
15749 #[doc = "Distance to target waypoint or position"]
15750 pub target_distance: u16,
15751 #[doc = "Current waypoint number"]
15752 pub wp_num: u16,
15753 #[doc = "Bitmap of failure flags."]
15754 pub failure_flags: HlFailureFlag,
15755 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15756 pub mavtype: MavType,
15757 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15758 pub autopilot: MavAutopilot,
15759 #[doc = "Heading"]
15760 pub heading: u8,
15761 #[doc = "Heading setpoint"]
15762 pub target_heading: u8,
15763 #[doc = "Throttle"]
15764 pub throttle: u8,
15765 #[doc = "Airspeed"]
15766 pub airspeed: u8,
15767 #[doc = "Airspeed setpoint"]
15768 pub airspeed_sp: u8,
15769 #[doc = "Groundspeed"]
15770 pub groundspeed: u8,
15771 #[doc = "Windspeed"]
15772 pub windspeed: u8,
15773 #[doc = "Wind heading"]
15774 pub wind_heading: u8,
15775 #[doc = "Maximum error horizontal position since last message"]
15776 pub eph: u8,
15777 #[doc = "Maximum error vertical position since last message"]
15778 pub epv: u8,
15779 #[doc = "Air temperature"]
15780 pub temperature_air: i8,
15781 #[doc = "Maximum climb rate magnitude since last message"]
15782 pub climb_rate: i8,
15783 #[doc = "Battery level (-1 if field not provided)."]
15784 pub battery: i8,
15785 #[doc = "Field for custom payload."]
15786 pub custom0: i8,
15787 #[doc = "Field for custom payload."]
15788 pub custom1: i8,
15789 #[doc = "Field for custom payload."]
15790 pub custom2: i8,
15791}
15792impl HIGH_LATENCY2_DATA {
15793 pub const ENCODED_LEN: usize = 42usize;
15794 pub const DEFAULT: Self = Self {
15795 timestamp: 0_u32,
15796 latitude: 0_i32,
15797 longitude: 0_i32,
15798 custom_mode: 0_u16,
15799 altitude: 0_i16,
15800 target_altitude: 0_i16,
15801 target_distance: 0_u16,
15802 wp_num: 0_u16,
15803 failure_flags: HlFailureFlag::DEFAULT,
15804 mavtype: MavType::DEFAULT,
15805 autopilot: MavAutopilot::DEFAULT,
15806 heading: 0_u8,
15807 target_heading: 0_u8,
15808 throttle: 0_u8,
15809 airspeed: 0_u8,
15810 airspeed_sp: 0_u8,
15811 groundspeed: 0_u8,
15812 windspeed: 0_u8,
15813 wind_heading: 0_u8,
15814 eph: 0_u8,
15815 epv: 0_u8,
15816 temperature_air: 0_i8,
15817 climb_rate: 0_i8,
15818 battery: 0_i8,
15819 custom0: 0_i8,
15820 custom1: 0_i8,
15821 custom2: 0_i8,
15822 };
15823 #[cfg(feature = "arbitrary")]
15824 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15825 use arbitrary::{Arbitrary, Unstructured};
15826 let mut buf = [0u8; 1024];
15827 rng.fill_bytes(&mut buf);
15828 let mut unstructured = Unstructured::new(&buf);
15829 Self::arbitrary(&mut unstructured).unwrap_or_default()
15830 }
15831}
15832impl Default for HIGH_LATENCY2_DATA {
15833 fn default() -> Self {
15834 Self::DEFAULT.clone()
15835 }
15836}
15837impl MessageData for HIGH_LATENCY2_DATA {
15838 type Message = MavMessage;
15839 const ID: u32 = 235u32;
15840 const NAME: &'static str = "HIGH_LATENCY2";
15841 const EXTRA_CRC: u8 = 179u8;
15842 const ENCODED_LEN: usize = 42usize;
15843 fn deser(
15844 _version: MavlinkVersion,
15845 __input: &[u8],
15846 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15847 let avail_len = __input.len();
15848 let mut payload_buf = [0; Self::ENCODED_LEN];
15849 let mut buf = if avail_len < Self::ENCODED_LEN {
15850 payload_buf[0..avail_len].copy_from_slice(__input);
15851 Bytes::new(&payload_buf)
15852 } else {
15853 Bytes::new(__input)
15854 };
15855 let mut __struct = Self::default();
15856 __struct.timestamp = buf.get_u32_le();
15857 __struct.latitude = buf.get_i32_le();
15858 __struct.longitude = buf.get_i32_le();
15859 __struct.custom_mode = buf.get_u16_le();
15860 __struct.altitude = buf.get_i16_le();
15861 __struct.target_altitude = buf.get_i16_le();
15862 __struct.target_distance = buf.get_u16_le();
15863 __struct.wp_num = buf.get_u16_le();
15864 let tmp = buf.get_u16_le();
15865 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15866 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15867 flag_type: "HlFailureFlag",
15868 value: tmp as u32,
15869 })?;
15870 let tmp = buf.get_u8();
15871 __struct.mavtype =
15872 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15873 enum_type: "MavType",
15874 value: tmp as u32,
15875 })?;
15876 let tmp = buf.get_u8();
15877 __struct.autopilot =
15878 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15879 enum_type: "MavAutopilot",
15880 value: tmp as u32,
15881 })?;
15882 __struct.heading = buf.get_u8();
15883 __struct.target_heading = buf.get_u8();
15884 __struct.throttle = buf.get_u8();
15885 __struct.airspeed = buf.get_u8();
15886 __struct.airspeed_sp = buf.get_u8();
15887 __struct.groundspeed = buf.get_u8();
15888 __struct.windspeed = buf.get_u8();
15889 __struct.wind_heading = buf.get_u8();
15890 __struct.eph = buf.get_u8();
15891 __struct.epv = buf.get_u8();
15892 __struct.temperature_air = buf.get_i8();
15893 __struct.climb_rate = buf.get_i8();
15894 __struct.battery = buf.get_i8();
15895 __struct.custom0 = buf.get_i8();
15896 __struct.custom1 = buf.get_i8();
15897 __struct.custom2 = buf.get_i8();
15898 Ok(__struct)
15899 }
15900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15901 let mut __tmp = BytesMut::new(bytes);
15902 #[allow(clippy::absurd_extreme_comparisons)]
15903 #[allow(unused_comparisons)]
15904 if __tmp.remaining() < Self::ENCODED_LEN {
15905 panic!(
15906 "buffer is too small (need {} bytes, but got {})",
15907 Self::ENCODED_LEN,
15908 __tmp.remaining(),
15909 )
15910 }
15911 __tmp.put_u32_le(self.timestamp);
15912 __tmp.put_i32_le(self.latitude);
15913 __tmp.put_i32_le(self.longitude);
15914 __tmp.put_u16_le(self.custom_mode);
15915 __tmp.put_i16_le(self.altitude);
15916 __tmp.put_i16_le(self.target_altitude);
15917 __tmp.put_u16_le(self.target_distance);
15918 __tmp.put_u16_le(self.wp_num);
15919 __tmp.put_u16_le(self.failure_flags.bits());
15920 __tmp.put_u8(self.mavtype as u8);
15921 __tmp.put_u8(self.autopilot as u8);
15922 __tmp.put_u8(self.heading);
15923 __tmp.put_u8(self.target_heading);
15924 __tmp.put_u8(self.throttle);
15925 __tmp.put_u8(self.airspeed);
15926 __tmp.put_u8(self.airspeed_sp);
15927 __tmp.put_u8(self.groundspeed);
15928 __tmp.put_u8(self.windspeed);
15929 __tmp.put_u8(self.wind_heading);
15930 __tmp.put_u8(self.eph);
15931 __tmp.put_u8(self.epv);
15932 __tmp.put_i8(self.temperature_air);
15933 __tmp.put_i8(self.climb_rate);
15934 __tmp.put_i8(self.battery);
15935 __tmp.put_i8(self.custom0);
15936 __tmp.put_i8(self.custom1);
15937 __tmp.put_i8(self.custom2);
15938 if matches!(version, MavlinkVersion::V2) {
15939 let len = __tmp.len();
15940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15941 } else {
15942 __tmp.len()
15943 }
15944 }
15945}
15946#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15947#[doc = ""]
15948#[doc = "ID: 93"]
15949#[derive(Debug, Clone, PartialEq)]
15950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15952#[cfg_attr(feature = "ts", derive(TS))]
15953#[cfg_attr(feature = "ts", ts(export))]
15954pub struct HIL_ACTUATOR_CONTROLS_DATA {
15955 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15956 pub time_usec: u64,
15957 #[doc = "Flags bitmask."]
15958 pub flags: HilActuatorControlsFlags,
15959 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15960 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15961 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15962 pub controls: [f32; 16],
15963 #[doc = "System mode. Includes arming state."]
15964 pub mode: MavModeFlag,
15965}
15966impl HIL_ACTUATOR_CONTROLS_DATA {
15967 pub const ENCODED_LEN: usize = 81usize;
15968 pub const DEFAULT: Self = Self {
15969 time_usec: 0_u64,
15970 flags: HilActuatorControlsFlags::DEFAULT,
15971 controls: [0.0_f32; 16usize],
15972 mode: MavModeFlag::DEFAULT,
15973 };
15974 #[cfg(feature = "arbitrary")]
15975 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15976 use arbitrary::{Arbitrary, Unstructured};
15977 let mut buf = [0u8; 1024];
15978 rng.fill_bytes(&mut buf);
15979 let mut unstructured = Unstructured::new(&buf);
15980 Self::arbitrary(&mut unstructured).unwrap_or_default()
15981 }
15982}
15983impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15984 fn default() -> Self {
15985 Self::DEFAULT.clone()
15986 }
15987}
15988impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15989 type Message = MavMessage;
15990 const ID: u32 = 93u32;
15991 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15992 const EXTRA_CRC: u8 = 47u8;
15993 const ENCODED_LEN: usize = 81usize;
15994 fn deser(
15995 _version: MavlinkVersion,
15996 __input: &[u8],
15997 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15998 let avail_len = __input.len();
15999 let mut payload_buf = [0; Self::ENCODED_LEN];
16000 let mut buf = if avail_len < Self::ENCODED_LEN {
16001 payload_buf[0..avail_len].copy_from_slice(__input);
16002 Bytes::new(&payload_buf)
16003 } else {
16004 Bytes::new(__input)
16005 };
16006 let mut __struct = Self::default();
16007 __struct.time_usec = buf.get_u64_le();
16008 let tmp = buf.get_u64_le();
16009 __struct.flags =
16010 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
16011 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16012 flag_type: "HilActuatorControlsFlags",
16013 value: tmp as u32,
16014 })?;
16015 for v in &mut __struct.controls {
16016 let val = buf.get_f32_le();
16017 *v = val;
16018 }
16019 let tmp = buf.get_u8();
16020 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
16021 ::mavlink_core::error::ParserError::InvalidFlag {
16022 flag_type: "MavModeFlag",
16023 value: tmp as u32,
16024 },
16025 )?;
16026 Ok(__struct)
16027 }
16028 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16029 let mut __tmp = BytesMut::new(bytes);
16030 #[allow(clippy::absurd_extreme_comparisons)]
16031 #[allow(unused_comparisons)]
16032 if __tmp.remaining() < Self::ENCODED_LEN {
16033 panic!(
16034 "buffer is too small (need {} bytes, but got {})",
16035 Self::ENCODED_LEN,
16036 __tmp.remaining(),
16037 )
16038 }
16039 __tmp.put_u64_le(self.time_usec);
16040 __tmp.put_u64_le(self.flags.bits());
16041 for val in &self.controls {
16042 __tmp.put_f32_le(*val);
16043 }
16044 __tmp.put_u8(self.mode.bits());
16045 if matches!(version, MavlinkVersion::V2) {
16046 let len = __tmp.len();
16047 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16048 } else {
16049 __tmp.len()
16050 }
16051 }
16052}
16053#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16054#[doc = ""]
16055#[doc = "ID: 91"]
16056#[derive(Debug, Clone, PartialEq)]
16057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16059#[cfg_attr(feature = "ts", derive(TS))]
16060#[cfg_attr(feature = "ts", ts(export))]
16061pub struct HIL_CONTROLS_DATA {
16062 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16063 pub time_usec: u64,
16064 #[doc = "Control output -1 .. 1"]
16065 pub roll_ailerons: f32,
16066 #[doc = "Control output -1 .. 1"]
16067 pub pitch_elevator: f32,
16068 #[doc = "Control output -1 .. 1"]
16069 pub yaw_rudder: f32,
16070 #[doc = "Throttle 0 .. 1"]
16071 pub throttle: f32,
16072 #[doc = "Aux 1, -1 .. 1"]
16073 pub aux1: f32,
16074 #[doc = "Aux 2, -1 .. 1"]
16075 pub aux2: f32,
16076 #[doc = "Aux 3, -1 .. 1"]
16077 pub aux3: f32,
16078 #[doc = "Aux 4, -1 .. 1"]
16079 pub aux4: f32,
16080 #[doc = "System mode."]
16081 pub mode: MavMode,
16082 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16083 pub nav_mode: u8,
16084}
16085impl HIL_CONTROLS_DATA {
16086 pub const ENCODED_LEN: usize = 42usize;
16087 pub const DEFAULT: Self = Self {
16088 time_usec: 0_u64,
16089 roll_ailerons: 0.0_f32,
16090 pitch_elevator: 0.0_f32,
16091 yaw_rudder: 0.0_f32,
16092 throttle: 0.0_f32,
16093 aux1: 0.0_f32,
16094 aux2: 0.0_f32,
16095 aux3: 0.0_f32,
16096 aux4: 0.0_f32,
16097 mode: MavMode::DEFAULT,
16098 nav_mode: 0_u8,
16099 };
16100 #[cfg(feature = "arbitrary")]
16101 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16102 use arbitrary::{Arbitrary, Unstructured};
16103 let mut buf = [0u8; 1024];
16104 rng.fill_bytes(&mut buf);
16105 let mut unstructured = Unstructured::new(&buf);
16106 Self::arbitrary(&mut unstructured).unwrap_or_default()
16107 }
16108}
16109impl Default for HIL_CONTROLS_DATA {
16110 fn default() -> Self {
16111 Self::DEFAULT.clone()
16112 }
16113}
16114impl MessageData for HIL_CONTROLS_DATA {
16115 type Message = MavMessage;
16116 const ID: u32 = 91u32;
16117 const NAME: &'static str = "HIL_CONTROLS";
16118 const EXTRA_CRC: u8 = 63u8;
16119 const ENCODED_LEN: usize = 42usize;
16120 fn deser(
16121 _version: MavlinkVersion,
16122 __input: &[u8],
16123 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16124 let avail_len = __input.len();
16125 let mut payload_buf = [0; Self::ENCODED_LEN];
16126 let mut buf = if avail_len < Self::ENCODED_LEN {
16127 payload_buf[0..avail_len].copy_from_slice(__input);
16128 Bytes::new(&payload_buf)
16129 } else {
16130 Bytes::new(__input)
16131 };
16132 let mut __struct = Self::default();
16133 __struct.time_usec = buf.get_u64_le();
16134 __struct.roll_ailerons = buf.get_f32_le();
16135 __struct.pitch_elevator = buf.get_f32_le();
16136 __struct.yaw_rudder = buf.get_f32_le();
16137 __struct.throttle = buf.get_f32_le();
16138 __struct.aux1 = buf.get_f32_le();
16139 __struct.aux2 = buf.get_f32_le();
16140 __struct.aux3 = buf.get_f32_le();
16141 __struct.aux4 = buf.get_f32_le();
16142 let tmp = buf.get_u8();
16143 __struct.mode =
16144 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16145 enum_type: "MavMode",
16146 value: tmp as u32,
16147 })?;
16148 __struct.nav_mode = buf.get_u8();
16149 Ok(__struct)
16150 }
16151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16152 let mut __tmp = BytesMut::new(bytes);
16153 #[allow(clippy::absurd_extreme_comparisons)]
16154 #[allow(unused_comparisons)]
16155 if __tmp.remaining() < Self::ENCODED_LEN {
16156 panic!(
16157 "buffer is too small (need {} bytes, but got {})",
16158 Self::ENCODED_LEN,
16159 __tmp.remaining(),
16160 )
16161 }
16162 __tmp.put_u64_le(self.time_usec);
16163 __tmp.put_f32_le(self.roll_ailerons);
16164 __tmp.put_f32_le(self.pitch_elevator);
16165 __tmp.put_f32_le(self.yaw_rudder);
16166 __tmp.put_f32_le(self.throttle);
16167 __tmp.put_f32_le(self.aux1);
16168 __tmp.put_f32_le(self.aux2);
16169 __tmp.put_f32_le(self.aux3);
16170 __tmp.put_f32_le(self.aux4);
16171 __tmp.put_u8(self.mode as u8);
16172 __tmp.put_u8(self.nav_mode);
16173 if matches!(version, MavlinkVersion::V2) {
16174 let len = __tmp.len();
16175 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16176 } else {
16177 __tmp.len()
16178 }
16179 }
16180}
16181#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16182#[doc = ""]
16183#[doc = "ID: 113"]
16184#[derive(Debug, Clone, PartialEq)]
16185#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16187#[cfg_attr(feature = "ts", derive(TS))]
16188#[cfg_attr(feature = "ts", ts(export))]
16189pub struct HIL_GPS_DATA {
16190 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16191 pub time_usec: u64,
16192 #[doc = "Latitude (WGS84)"]
16193 pub lat: i32,
16194 #[doc = "Longitude (WGS84)"]
16195 pub lon: i32,
16196 #[doc = "Altitude (MSL). Positive for up."]
16197 pub alt: i32,
16198 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16199 pub eph: u16,
16200 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16201 pub epv: u16,
16202 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16203 pub vel: u16,
16204 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16205 pub vn: i16,
16206 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16207 pub ve: i16,
16208 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16209 pub vd: i16,
16210 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16211 pub cog: u16,
16212 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16213 pub fix_type: u8,
16214 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16215 pub satellites_visible: u8,
16216 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16217 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16218 pub id: u8,
16219 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16220 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16221 pub yaw: u16,
16222}
16223impl HIL_GPS_DATA {
16224 pub const ENCODED_LEN: usize = 39usize;
16225 pub const DEFAULT: Self = Self {
16226 time_usec: 0_u64,
16227 lat: 0_i32,
16228 lon: 0_i32,
16229 alt: 0_i32,
16230 eph: 0_u16,
16231 epv: 0_u16,
16232 vel: 0_u16,
16233 vn: 0_i16,
16234 ve: 0_i16,
16235 vd: 0_i16,
16236 cog: 0_u16,
16237 fix_type: 0_u8,
16238 satellites_visible: 0_u8,
16239 id: 0_u8,
16240 yaw: 0_u16,
16241 };
16242 #[cfg(feature = "arbitrary")]
16243 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16244 use arbitrary::{Arbitrary, Unstructured};
16245 let mut buf = [0u8; 1024];
16246 rng.fill_bytes(&mut buf);
16247 let mut unstructured = Unstructured::new(&buf);
16248 Self::arbitrary(&mut unstructured).unwrap_or_default()
16249 }
16250}
16251impl Default for HIL_GPS_DATA {
16252 fn default() -> Self {
16253 Self::DEFAULT.clone()
16254 }
16255}
16256impl MessageData for HIL_GPS_DATA {
16257 type Message = MavMessage;
16258 const ID: u32 = 113u32;
16259 const NAME: &'static str = "HIL_GPS";
16260 const EXTRA_CRC: u8 = 124u8;
16261 const ENCODED_LEN: usize = 39usize;
16262 fn deser(
16263 _version: MavlinkVersion,
16264 __input: &[u8],
16265 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16266 let avail_len = __input.len();
16267 let mut payload_buf = [0; Self::ENCODED_LEN];
16268 let mut buf = if avail_len < Self::ENCODED_LEN {
16269 payload_buf[0..avail_len].copy_from_slice(__input);
16270 Bytes::new(&payload_buf)
16271 } else {
16272 Bytes::new(__input)
16273 };
16274 let mut __struct = Self::default();
16275 __struct.time_usec = buf.get_u64_le();
16276 __struct.lat = buf.get_i32_le();
16277 __struct.lon = buf.get_i32_le();
16278 __struct.alt = buf.get_i32_le();
16279 __struct.eph = buf.get_u16_le();
16280 __struct.epv = buf.get_u16_le();
16281 __struct.vel = buf.get_u16_le();
16282 __struct.vn = buf.get_i16_le();
16283 __struct.ve = buf.get_i16_le();
16284 __struct.vd = buf.get_i16_le();
16285 __struct.cog = buf.get_u16_le();
16286 __struct.fix_type = buf.get_u8();
16287 __struct.satellites_visible = buf.get_u8();
16288 __struct.id = buf.get_u8();
16289 __struct.yaw = buf.get_u16_le();
16290 Ok(__struct)
16291 }
16292 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16293 let mut __tmp = BytesMut::new(bytes);
16294 #[allow(clippy::absurd_extreme_comparisons)]
16295 #[allow(unused_comparisons)]
16296 if __tmp.remaining() < Self::ENCODED_LEN {
16297 panic!(
16298 "buffer is too small (need {} bytes, but got {})",
16299 Self::ENCODED_LEN,
16300 __tmp.remaining(),
16301 )
16302 }
16303 __tmp.put_u64_le(self.time_usec);
16304 __tmp.put_i32_le(self.lat);
16305 __tmp.put_i32_le(self.lon);
16306 __tmp.put_i32_le(self.alt);
16307 __tmp.put_u16_le(self.eph);
16308 __tmp.put_u16_le(self.epv);
16309 __tmp.put_u16_le(self.vel);
16310 __tmp.put_i16_le(self.vn);
16311 __tmp.put_i16_le(self.ve);
16312 __tmp.put_i16_le(self.vd);
16313 __tmp.put_u16_le(self.cog);
16314 __tmp.put_u8(self.fix_type);
16315 __tmp.put_u8(self.satellites_visible);
16316 if matches!(version, MavlinkVersion::V2) {
16317 __tmp.put_u8(self.id);
16318 __tmp.put_u16_le(self.yaw);
16319 let len = __tmp.len();
16320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16321 } else {
16322 __tmp.len()
16323 }
16324 }
16325}
16326#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16327#[doc = ""]
16328#[doc = "ID: 114"]
16329#[derive(Debug, Clone, PartialEq)]
16330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16332#[cfg_attr(feature = "ts", derive(TS))]
16333#[cfg_attr(feature = "ts", ts(export))]
16334pub struct HIL_OPTICAL_FLOW_DATA {
16335 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16336 pub time_usec: u64,
16337 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16338 pub integration_time_us: u32,
16339 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16340 pub integrated_x: f32,
16341 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16342 pub integrated_y: f32,
16343 #[doc = "RH rotation around X axis"]
16344 pub integrated_xgyro: f32,
16345 #[doc = "RH rotation around Y axis"]
16346 pub integrated_ygyro: f32,
16347 #[doc = "RH rotation around Z axis"]
16348 pub integrated_zgyro: f32,
16349 #[doc = "Time since the distance was sampled."]
16350 pub time_delta_distance_us: u32,
16351 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16352 pub distance: f32,
16353 #[doc = "Temperature"]
16354 pub temperature: i16,
16355 #[doc = "Sensor ID"]
16356 pub sensor_id: u8,
16357 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16358 pub quality: u8,
16359}
16360impl HIL_OPTICAL_FLOW_DATA {
16361 pub const ENCODED_LEN: usize = 44usize;
16362 pub const DEFAULT: Self = Self {
16363 time_usec: 0_u64,
16364 integration_time_us: 0_u32,
16365 integrated_x: 0.0_f32,
16366 integrated_y: 0.0_f32,
16367 integrated_xgyro: 0.0_f32,
16368 integrated_ygyro: 0.0_f32,
16369 integrated_zgyro: 0.0_f32,
16370 time_delta_distance_us: 0_u32,
16371 distance: 0.0_f32,
16372 temperature: 0_i16,
16373 sensor_id: 0_u8,
16374 quality: 0_u8,
16375 };
16376 #[cfg(feature = "arbitrary")]
16377 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16378 use arbitrary::{Arbitrary, Unstructured};
16379 let mut buf = [0u8; 1024];
16380 rng.fill_bytes(&mut buf);
16381 let mut unstructured = Unstructured::new(&buf);
16382 Self::arbitrary(&mut unstructured).unwrap_or_default()
16383 }
16384}
16385impl Default for HIL_OPTICAL_FLOW_DATA {
16386 fn default() -> Self {
16387 Self::DEFAULT.clone()
16388 }
16389}
16390impl MessageData for HIL_OPTICAL_FLOW_DATA {
16391 type Message = MavMessage;
16392 const ID: u32 = 114u32;
16393 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16394 const EXTRA_CRC: u8 = 237u8;
16395 const ENCODED_LEN: usize = 44usize;
16396 fn deser(
16397 _version: MavlinkVersion,
16398 __input: &[u8],
16399 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16400 let avail_len = __input.len();
16401 let mut payload_buf = [0; Self::ENCODED_LEN];
16402 let mut buf = if avail_len < Self::ENCODED_LEN {
16403 payload_buf[0..avail_len].copy_from_slice(__input);
16404 Bytes::new(&payload_buf)
16405 } else {
16406 Bytes::new(__input)
16407 };
16408 let mut __struct = Self::default();
16409 __struct.time_usec = buf.get_u64_le();
16410 __struct.integration_time_us = buf.get_u32_le();
16411 __struct.integrated_x = buf.get_f32_le();
16412 __struct.integrated_y = buf.get_f32_le();
16413 __struct.integrated_xgyro = buf.get_f32_le();
16414 __struct.integrated_ygyro = buf.get_f32_le();
16415 __struct.integrated_zgyro = buf.get_f32_le();
16416 __struct.time_delta_distance_us = buf.get_u32_le();
16417 __struct.distance = buf.get_f32_le();
16418 __struct.temperature = buf.get_i16_le();
16419 __struct.sensor_id = buf.get_u8();
16420 __struct.quality = buf.get_u8();
16421 Ok(__struct)
16422 }
16423 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16424 let mut __tmp = BytesMut::new(bytes);
16425 #[allow(clippy::absurd_extreme_comparisons)]
16426 #[allow(unused_comparisons)]
16427 if __tmp.remaining() < Self::ENCODED_LEN {
16428 panic!(
16429 "buffer is too small (need {} bytes, but got {})",
16430 Self::ENCODED_LEN,
16431 __tmp.remaining(),
16432 )
16433 }
16434 __tmp.put_u64_le(self.time_usec);
16435 __tmp.put_u32_le(self.integration_time_us);
16436 __tmp.put_f32_le(self.integrated_x);
16437 __tmp.put_f32_le(self.integrated_y);
16438 __tmp.put_f32_le(self.integrated_xgyro);
16439 __tmp.put_f32_le(self.integrated_ygyro);
16440 __tmp.put_f32_le(self.integrated_zgyro);
16441 __tmp.put_u32_le(self.time_delta_distance_us);
16442 __tmp.put_f32_le(self.distance);
16443 __tmp.put_i16_le(self.temperature);
16444 __tmp.put_u8(self.sensor_id);
16445 __tmp.put_u8(self.quality);
16446 if matches!(version, MavlinkVersion::V2) {
16447 let len = __tmp.len();
16448 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16449 } else {
16450 __tmp.len()
16451 }
16452 }
16453}
16454#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16455#[doc = ""]
16456#[doc = "ID: 92"]
16457#[derive(Debug, Clone, PartialEq)]
16458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16460#[cfg_attr(feature = "ts", derive(TS))]
16461#[cfg_attr(feature = "ts", ts(export))]
16462pub struct HIL_RC_INPUTS_RAW_DATA {
16463 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16464 pub time_usec: u64,
16465 #[doc = "RC channel 1 value"]
16466 pub chan1_raw: u16,
16467 #[doc = "RC channel 2 value"]
16468 pub chan2_raw: u16,
16469 #[doc = "RC channel 3 value"]
16470 pub chan3_raw: u16,
16471 #[doc = "RC channel 4 value"]
16472 pub chan4_raw: u16,
16473 #[doc = "RC channel 5 value"]
16474 pub chan5_raw: u16,
16475 #[doc = "RC channel 6 value"]
16476 pub chan6_raw: u16,
16477 #[doc = "RC channel 7 value"]
16478 pub chan7_raw: u16,
16479 #[doc = "RC channel 8 value"]
16480 pub chan8_raw: u16,
16481 #[doc = "RC channel 9 value"]
16482 pub chan9_raw: u16,
16483 #[doc = "RC channel 10 value"]
16484 pub chan10_raw: u16,
16485 #[doc = "RC channel 11 value"]
16486 pub chan11_raw: u16,
16487 #[doc = "RC channel 12 value"]
16488 pub chan12_raw: u16,
16489 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16490 pub rssi: u8,
16491}
16492impl HIL_RC_INPUTS_RAW_DATA {
16493 pub const ENCODED_LEN: usize = 33usize;
16494 pub const DEFAULT: Self = Self {
16495 time_usec: 0_u64,
16496 chan1_raw: 0_u16,
16497 chan2_raw: 0_u16,
16498 chan3_raw: 0_u16,
16499 chan4_raw: 0_u16,
16500 chan5_raw: 0_u16,
16501 chan6_raw: 0_u16,
16502 chan7_raw: 0_u16,
16503 chan8_raw: 0_u16,
16504 chan9_raw: 0_u16,
16505 chan10_raw: 0_u16,
16506 chan11_raw: 0_u16,
16507 chan12_raw: 0_u16,
16508 rssi: 0_u8,
16509 };
16510 #[cfg(feature = "arbitrary")]
16511 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16512 use arbitrary::{Arbitrary, Unstructured};
16513 let mut buf = [0u8; 1024];
16514 rng.fill_bytes(&mut buf);
16515 let mut unstructured = Unstructured::new(&buf);
16516 Self::arbitrary(&mut unstructured).unwrap_or_default()
16517 }
16518}
16519impl Default for HIL_RC_INPUTS_RAW_DATA {
16520 fn default() -> Self {
16521 Self::DEFAULT.clone()
16522 }
16523}
16524impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16525 type Message = MavMessage;
16526 const ID: u32 = 92u32;
16527 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16528 const EXTRA_CRC: u8 = 54u8;
16529 const ENCODED_LEN: usize = 33usize;
16530 fn deser(
16531 _version: MavlinkVersion,
16532 __input: &[u8],
16533 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16534 let avail_len = __input.len();
16535 let mut payload_buf = [0; Self::ENCODED_LEN];
16536 let mut buf = if avail_len < Self::ENCODED_LEN {
16537 payload_buf[0..avail_len].copy_from_slice(__input);
16538 Bytes::new(&payload_buf)
16539 } else {
16540 Bytes::new(__input)
16541 };
16542 let mut __struct = Self::default();
16543 __struct.time_usec = buf.get_u64_le();
16544 __struct.chan1_raw = buf.get_u16_le();
16545 __struct.chan2_raw = buf.get_u16_le();
16546 __struct.chan3_raw = buf.get_u16_le();
16547 __struct.chan4_raw = buf.get_u16_le();
16548 __struct.chan5_raw = buf.get_u16_le();
16549 __struct.chan6_raw = buf.get_u16_le();
16550 __struct.chan7_raw = buf.get_u16_le();
16551 __struct.chan8_raw = buf.get_u16_le();
16552 __struct.chan9_raw = buf.get_u16_le();
16553 __struct.chan10_raw = buf.get_u16_le();
16554 __struct.chan11_raw = buf.get_u16_le();
16555 __struct.chan12_raw = buf.get_u16_le();
16556 __struct.rssi = buf.get_u8();
16557 Ok(__struct)
16558 }
16559 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16560 let mut __tmp = BytesMut::new(bytes);
16561 #[allow(clippy::absurd_extreme_comparisons)]
16562 #[allow(unused_comparisons)]
16563 if __tmp.remaining() < Self::ENCODED_LEN {
16564 panic!(
16565 "buffer is too small (need {} bytes, but got {})",
16566 Self::ENCODED_LEN,
16567 __tmp.remaining(),
16568 )
16569 }
16570 __tmp.put_u64_le(self.time_usec);
16571 __tmp.put_u16_le(self.chan1_raw);
16572 __tmp.put_u16_le(self.chan2_raw);
16573 __tmp.put_u16_le(self.chan3_raw);
16574 __tmp.put_u16_le(self.chan4_raw);
16575 __tmp.put_u16_le(self.chan5_raw);
16576 __tmp.put_u16_le(self.chan6_raw);
16577 __tmp.put_u16_le(self.chan7_raw);
16578 __tmp.put_u16_le(self.chan8_raw);
16579 __tmp.put_u16_le(self.chan9_raw);
16580 __tmp.put_u16_le(self.chan10_raw);
16581 __tmp.put_u16_le(self.chan11_raw);
16582 __tmp.put_u16_le(self.chan12_raw);
16583 __tmp.put_u8(self.rssi);
16584 if matches!(version, MavlinkVersion::V2) {
16585 let len = __tmp.len();
16586 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16587 } else {
16588 __tmp.len()
16589 }
16590 }
16591}
16592#[doc = "The IMU readings in SI units in NED body frame."]
16593#[doc = ""]
16594#[doc = "ID: 107"]
16595#[derive(Debug, Clone, PartialEq)]
16596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16598#[cfg_attr(feature = "ts", derive(TS))]
16599#[cfg_attr(feature = "ts", ts(export))]
16600pub struct HIL_SENSOR_DATA {
16601 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16602 pub time_usec: u64,
16603 #[doc = "X acceleration"]
16604 pub xacc: f32,
16605 #[doc = "Y acceleration"]
16606 pub yacc: f32,
16607 #[doc = "Z acceleration"]
16608 pub zacc: f32,
16609 #[doc = "Angular speed around X axis in body frame"]
16610 pub xgyro: f32,
16611 #[doc = "Angular speed around Y axis in body frame"]
16612 pub ygyro: f32,
16613 #[doc = "Angular speed around Z axis in body frame"]
16614 pub zgyro: f32,
16615 #[doc = "X Magnetic field"]
16616 pub xmag: f32,
16617 #[doc = "Y Magnetic field"]
16618 pub ymag: f32,
16619 #[doc = "Z Magnetic field"]
16620 pub zmag: f32,
16621 #[doc = "Absolute pressure"]
16622 pub abs_pressure: f32,
16623 #[doc = "Differential pressure (airspeed)"]
16624 pub diff_pressure: f32,
16625 #[doc = "Altitude calculated from pressure"]
16626 pub pressure_alt: f32,
16627 #[doc = "Temperature"]
16628 pub temperature: f32,
16629 #[doc = "Bitmap for fields that have updated since last message"]
16630 pub fields_updated: HilSensorUpdatedFlags,
16631 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16632 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16633 pub id: u8,
16634}
16635impl HIL_SENSOR_DATA {
16636 pub const ENCODED_LEN: usize = 65usize;
16637 pub const DEFAULT: Self = Self {
16638 time_usec: 0_u64,
16639 xacc: 0.0_f32,
16640 yacc: 0.0_f32,
16641 zacc: 0.0_f32,
16642 xgyro: 0.0_f32,
16643 ygyro: 0.0_f32,
16644 zgyro: 0.0_f32,
16645 xmag: 0.0_f32,
16646 ymag: 0.0_f32,
16647 zmag: 0.0_f32,
16648 abs_pressure: 0.0_f32,
16649 diff_pressure: 0.0_f32,
16650 pressure_alt: 0.0_f32,
16651 temperature: 0.0_f32,
16652 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16653 id: 0_u8,
16654 };
16655 #[cfg(feature = "arbitrary")]
16656 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16657 use arbitrary::{Arbitrary, Unstructured};
16658 let mut buf = [0u8; 1024];
16659 rng.fill_bytes(&mut buf);
16660 let mut unstructured = Unstructured::new(&buf);
16661 Self::arbitrary(&mut unstructured).unwrap_or_default()
16662 }
16663}
16664impl Default for HIL_SENSOR_DATA {
16665 fn default() -> Self {
16666 Self::DEFAULT.clone()
16667 }
16668}
16669impl MessageData for HIL_SENSOR_DATA {
16670 type Message = MavMessage;
16671 const ID: u32 = 107u32;
16672 const NAME: &'static str = "HIL_SENSOR";
16673 const EXTRA_CRC: u8 = 108u8;
16674 const ENCODED_LEN: usize = 65usize;
16675 fn deser(
16676 _version: MavlinkVersion,
16677 __input: &[u8],
16678 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16679 let avail_len = __input.len();
16680 let mut payload_buf = [0; Self::ENCODED_LEN];
16681 let mut buf = if avail_len < Self::ENCODED_LEN {
16682 payload_buf[0..avail_len].copy_from_slice(__input);
16683 Bytes::new(&payload_buf)
16684 } else {
16685 Bytes::new(__input)
16686 };
16687 let mut __struct = Self::default();
16688 __struct.time_usec = buf.get_u64_le();
16689 __struct.xacc = buf.get_f32_le();
16690 __struct.yacc = buf.get_f32_le();
16691 __struct.zacc = buf.get_f32_le();
16692 __struct.xgyro = buf.get_f32_le();
16693 __struct.ygyro = buf.get_f32_le();
16694 __struct.zgyro = buf.get_f32_le();
16695 __struct.xmag = buf.get_f32_le();
16696 __struct.ymag = buf.get_f32_le();
16697 __struct.zmag = buf.get_f32_le();
16698 __struct.abs_pressure = buf.get_f32_le();
16699 __struct.diff_pressure = buf.get_f32_le();
16700 __struct.pressure_alt = buf.get_f32_le();
16701 __struct.temperature = buf.get_f32_le();
16702 let tmp = buf.get_u32_le();
16703 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16704 tmp & HilSensorUpdatedFlags::all().bits(),
16705 )
16706 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16707 flag_type: "HilSensorUpdatedFlags",
16708 value: tmp as u32,
16709 })?;
16710 __struct.id = buf.get_u8();
16711 Ok(__struct)
16712 }
16713 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16714 let mut __tmp = BytesMut::new(bytes);
16715 #[allow(clippy::absurd_extreme_comparisons)]
16716 #[allow(unused_comparisons)]
16717 if __tmp.remaining() < Self::ENCODED_LEN {
16718 panic!(
16719 "buffer is too small (need {} bytes, but got {})",
16720 Self::ENCODED_LEN,
16721 __tmp.remaining(),
16722 )
16723 }
16724 __tmp.put_u64_le(self.time_usec);
16725 __tmp.put_f32_le(self.xacc);
16726 __tmp.put_f32_le(self.yacc);
16727 __tmp.put_f32_le(self.zacc);
16728 __tmp.put_f32_le(self.xgyro);
16729 __tmp.put_f32_le(self.ygyro);
16730 __tmp.put_f32_le(self.zgyro);
16731 __tmp.put_f32_le(self.xmag);
16732 __tmp.put_f32_le(self.ymag);
16733 __tmp.put_f32_le(self.zmag);
16734 __tmp.put_f32_le(self.abs_pressure);
16735 __tmp.put_f32_le(self.diff_pressure);
16736 __tmp.put_f32_le(self.pressure_alt);
16737 __tmp.put_f32_le(self.temperature);
16738 __tmp.put_u32_le(self.fields_updated.bits());
16739 if matches!(version, MavlinkVersion::V2) {
16740 __tmp.put_u8(self.id);
16741 let len = __tmp.len();
16742 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16743 } else {
16744 __tmp.len()
16745 }
16746 }
16747}
16748#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16749#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16750#[doc = ""]
16751#[doc = "ID: 90"]
16752#[derive(Debug, Clone, PartialEq)]
16753#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16755#[cfg_attr(feature = "ts", derive(TS))]
16756#[cfg_attr(feature = "ts", ts(export))]
16757pub struct HIL_STATE_DATA {
16758 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16759 pub time_usec: u64,
16760 #[doc = "Roll angle"]
16761 pub roll: f32,
16762 #[doc = "Pitch angle"]
16763 pub pitch: f32,
16764 #[doc = "Yaw angle"]
16765 pub yaw: f32,
16766 #[doc = "Body frame roll / phi angular speed"]
16767 pub rollspeed: f32,
16768 #[doc = "Body frame pitch / theta angular speed"]
16769 pub pitchspeed: f32,
16770 #[doc = "Body frame yaw / psi angular speed"]
16771 pub yawspeed: f32,
16772 #[doc = "Latitude"]
16773 pub lat: i32,
16774 #[doc = "Longitude"]
16775 pub lon: i32,
16776 #[doc = "Altitude"]
16777 pub alt: i32,
16778 #[doc = "Ground X Speed (Latitude)"]
16779 pub vx: i16,
16780 #[doc = "Ground Y Speed (Longitude)"]
16781 pub vy: i16,
16782 #[doc = "Ground Z Speed (Altitude)"]
16783 pub vz: i16,
16784 #[doc = "X acceleration"]
16785 pub xacc: i16,
16786 #[doc = "Y acceleration"]
16787 pub yacc: i16,
16788 #[doc = "Z acceleration"]
16789 pub zacc: i16,
16790}
16791impl HIL_STATE_DATA {
16792 pub const ENCODED_LEN: usize = 56usize;
16793 pub const DEFAULT: Self = Self {
16794 time_usec: 0_u64,
16795 roll: 0.0_f32,
16796 pitch: 0.0_f32,
16797 yaw: 0.0_f32,
16798 rollspeed: 0.0_f32,
16799 pitchspeed: 0.0_f32,
16800 yawspeed: 0.0_f32,
16801 lat: 0_i32,
16802 lon: 0_i32,
16803 alt: 0_i32,
16804 vx: 0_i16,
16805 vy: 0_i16,
16806 vz: 0_i16,
16807 xacc: 0_i16,
16808 yacc: 0_i16,
16809 zacc: 0_i16,
16810 };
16811 #[cfg(feature = "arbitrary")]
16812 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16813 use arbitrary::{Arbitrary, Unstructured};
16814 let mut buf = [0u8; 1024];
16815 rng.fill_bytes(&mut buf);
16816 let mut unstructured = Unstructured::new(&buf);
16817 Self::arbitrary(&mut unstructured).unwrap_or_default()
16818 }
16819}
16820impl Default for HIL_STATE_DATA {
16821 fn default() -> Self {
16822 Self::DEFAULT.clone()
16823 }
16824}
16825impl MessageData for HIL_STATE_DATA {
16826 type Message = MavMessage;
16827 const ID: u32 = 90u32;
16828 const NAME: &'static str = "HIL_STATE";
16829 const EXTRA_CRC: u8 = 183u8;
16830 const ENCODED_LEN: usize = 56usize;
16831 fn deser(
16832 _version: MavlinkVersion,
16833 __input: &[u8],
16834 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16835 let avail_len = __input.len();
16836 let mut payload_buf = [0; Self::ENCODED_LEN];
16837 let mut buf = if avail_len < Self::ENCODED_LEN {
16838 payload_buf[0..avail_len].copy_from_slice(__input);
16839 Bytes::new(&payload_buf)
16840 } else {
16841 Bytes::new(__input)
16842 };
16843 let mut __struct = Self::default();
16844 __struct.time_usec = buf.get_u64_le();
16845 __struct.roll = buf.get_f32_le();
16846 __struct.pitch = buf.get_f32_le();
16847 __struct.yaw = buf.get_f32_le();
16848 __struct.rollspeed = buf.get_f32_le();
16849 __struct.pitchspeed = buf.get_f32_le();
16850 __struct.yawspeed = buf.get_f32_le();
16851 __struct.lat = buf.get_i32_le();
16852 __struct.lon = buf.get_i32_le();
16853 __struct.alt = buf.get_i32_le();
16854 __struct.vx = buf.get_i16_le();
16855 __struct.vy = buf.get_i16_le();
16856 __struct.vz = buf.get_i16_le();
16857 __struct.xacc = buf.get_i16_le();
16858 __struct.yacc = buf.get_i16_le();
16859 __struct.zacc = buf.get_i16_le();
16860 Ok(__struct)
16861 }
16862 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16863 let mut __tmp = BytesMut::new(bytes);
16864 #[allow(clippy::absurd_extreme_comparisons)]
16865 #[allow(unused_comparisons)]
16866 if __tmp.remaining() < Self::ENCODED_LEN {
16867 panic!(
16868 "buffer is too small (need {} bytes, but got {})",
16869 Self::ENCODED_LEN,
16870 __tmp.remaining(),
16871 )
16872 }
16873 __tmp.put_u64_le(self.time_usec);
16874 __tmp.put_f32_le(self.roll);
16875 __tmp.put_f32_le(self.pitch);
16876 __tmp.put_f32_le(self.yaw);
16877 __tmp.put_f32_le(self.rollspeed);
16878 __tmp.put_f32_le(self.pitchspeed);
16879 __tmp.put_f32_le(self.yawspeed);
16880 __tmp.put_i32_le(self.lat);
16881 __tmp.put_i32_le(self.lon);
16882 __tmp.put_i32_le(self.alt);
16883 __tmp.put_i16_le(self.vx);
16884 __tmp.put_i16_le(self.vy);
16885 __tmp.put_i16_le(self.vz);
16886 __tmp.put_i16_le(self.xacc);
16887 __tmp.put_i16_le(self.yacc);
16888 __tmp.put_i16_le(self.zacc);
16889 if matches!(version, MavlinkVersion::V2) {
16890 let len = __tmp.len();
16891 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16892 } else {
16893 __tmp.len()
16894 }
16895 }
16896}
16897#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16898#[doc = ""]
16899#[doc = "ID: 115"]
16900#[derive(Debug, Clone, PartialEq)]
16901#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16902#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16903#[cfg_attr(feature = "ts", derive(TS))]
16904#[cfg_attr(feature = "ts", ts(export))]
16905pub struct HIL_STATE_QUATERNION_DATA {
16906 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16907 pub time_usec: u64,
16908 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16909 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16910 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16911 pub attitude_quaternion: [f32; 4],
16912 #[doc = "Body frame roll / phi angular speed"]
16913 pub rollspeed: f32,
16914 #[doc = "Body frame pitch / theta angular speed"]
16915 pub pitchspeed: f32,
16916 #[doc = "Body frame yaw / psi angular speed"]
16917 pub yawspeed: f32,
16918 #[doc = "Latitude"]
16919 pub lat: i32,
16920 #[doc = "Longitude"]
16921 pub lon: i32,
16922 #[doc = "Altitude"]
16923 pub alt: i32,
16924 #[doc = "Ground X Speed (Latitude)"]
16925 pub vx: i16,
16926 #[doc = "Ground Y Speed (Longitude)"]
16927 pub vy: i16,
16928 #[doc = "Ground Z Speed (Altitude)"]
16929 pub vz: i16,
16930 #[doc = "Indicated airspeed"]
16931 pub ind_airspeed: u16,
16932 #[doc = "True airspeed"]
16933 pub true_airspeed: u16,
16934 #[doc = "X acceleration"]
16935 pub xacc: i16,
16936 #[doc = "Y acceleration"]
16937 pub yacc: i16,
16938 #[doc = "Z acceleration"]
16939 pub zacc: i16,
16940}
16941impl HIL_STATE_QUATERNION_DATA {
16942 pub const ENCODED_LEN: usize = 64usize;
16943 pub const DEFAULT: Self = Self {
16944 time_usec: 0_u64,
16945 attitude_quaternion: [0.0_f32; 4usize],
16946 rollspeed: 0.0_f32,
16947 pitchspeed: 0.0_f32,
16948 yawspeed: 0.0_f32,
16949 lat: 0_i32,
16950 lon: 0_i32,
16951 alt: 0_i32,
16952 vx: 0_i16,
16953 vy: 0_i16,
16954 vz: 0_i16,
16955 ind_airspeed: 0_u16,
16956 true_airspeed: 0_u16,
16957 xacc: 0_i16,
16958 yacc: 0_i16,
16959 zacc: 0_i16,
16960 };
16961 #[cfg(feature = "arbitrary")]
16962 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16963 use arbitrary::{Arbitrary, Unstructured};
16964 let mut buf = [0u8; 1024];
16965 rng.fill_bytes(&mut buf);
16966 let mut unstructured = Unstructured::new(&buf);
16967 Self::arbitrary(&mut unstructured).unwrap_or_default()
16968 }
16969}
16970impl Default for HIL_STATE_QUATERNION_DATA {
16971 fn default() -> Self {
16972 Self::DEFAULT.clone()
16973 }
16974}
16975impl MessageData for HIL_STATE_QUATERNION_DATA {
16976 type Message = MavMessage;
16977 const ID: u32 = 115u32;
16978 const NAME: &'static str = "HIL_STATE_QUATERNION";
16979 const EXTRA_CRC: u8 = 4u8;
16980 const ENCODED_LEN: usize = 64usize;
16981 fn deser(
16982 _version: MavlinkVersion,
16983 __input: &[u8],
16984 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16985 let avail_len = __input.len();
16986 let mut payload_buf = [0; Self::ENCODED_LEN];
16987 let mut buf = if avail_len < Self::ENCODED_LEN {
16988 payload_buf[0..avail_len].copy_from_slice(__input);
16989 Bytes::new(&payload_buf)
16990 } else {
16991 Bytes::new(__input)
16992 };
16993 let mut __struct = Self::default();
16994 __struct.time_usec = buf.get_u64_le();
16995 for v in &mut __struct.attitude_quaternion {
16996 let val = buf.get_f32_le();
16997 *v = val;
16998 }
16999 __struct.rollspeed = buf.get_f32_le();
17000 __struct.pitchspeed = buf.get_f32_le();
17001 __struct.yawspeed = buf.get_f32_le();
17002 __struct.lat = buf.get_i32_le();
17003 __struct.lon = buf.get_i32_le();
17004 __struct.alt = buf.get_i32_le();
17005 __struct.vx = buf.get_i16_le();
17006 __struct.vy = buf.get_i16_le();
17007 __struct.vz = buf.get_i16_le();
17008 __struct.ind_airspeed = buf.get_u16_le();
17009 __struct.true_airspeed = buf.get_u16_le();
17010 __struct.xacc = buf.get_i16_le();
17011 __struct.yacc = buf.get_i16_le();
17012 __struct.zacc = buf.get_i16_le();
17013 Ok(__struct)
17014 }
17015 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17016 let mut __tmp = BytesMut::new(bytes);
17017 #[allow(clippy::absurd_extreme_comparisons)]
17018 #[allow(unused_comparisons)]
17019 if __tmp.remaining() < Self::ENCODED_LEN {
17020 panic!(
17021 "buffer is too small (need {} bytes, but got {})",
17022 Self::ENCODED_LEN,
17023 __tmp.remaining(),
17024 )
17025 }
17026 __tmp.put_u64_le(self.time_usec);
17027 for val in &self.attitude_quaternion {
17028 __tmp.put_f32_le(*val);
17029 }
17030 __tmp.put_f32_le(self.rollspeed);
17031 __tmp.put_f32_le(self.pitchspeed);
17032 __tmp.put_f32_le(self.yawspeed);
17033 __tmp.put_i32_le(self.lat);
17034 __tmp.put_i32_le(self.lon);
17035 __tmp.put_i32_le(self.alt);
17036 __tmp.put_i16_le(self.vx);
17037 __tmp.put_i16_le(self.vy);
17038 __tmp.put_i16_le(self.vz);
17039 __tmp.put_u16_le(self.ind_airspeed);
17040 __tmp.put_u16_le(self.true_airspeed);
17041 __tmp.put_i16_le(self.xacc);
17042 __tmp.put_i16_le(self.yacc);
17043 __tmp.put_i16_le(self.zacc);
17044 if matches!(version, MavlinkVersion::V2) {
17045 let len = __tmp.len();
17046 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17047 } else {
17048 __tmp.len()
17049 }
17050 }
17051}
17052#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
17053#[doc = ""]
17054#[doc = "ID: 242"]
17055#[derive(Debug, Clone, PartialEq)]
17056#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17057#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17058#[cfg_attr(feature = "ts", derive(TS))]
17059#[cfg_attr(feature = "ts", ts(export))]
17060pub struct HOME_POSITION_DATA {
17061 #[doc = "Latitude (WGS84)"]
17062 pub latitude: i32,
17063 #[doc = "Longitude (WGS84)"]
17064 pub longitude: i32,
17065 #[doc = "Altitude (MSL). Positive for up."]
17066 pub altitude: i32,
17067 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
17068 pub x: f32,
17069 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
17070 pub y: f32,
17071 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
17072 pub z: f32,
17073 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
17074 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17075 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17076 pub q: [f32; 4],
17077 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17078 pub approach_x: f32,
17079 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17080 pub approach_y: f32,
17081 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17082 pub approach_z: f32,
17083 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17084 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17085 pub time_usec: u64,
17086}
17087impl HOME_POSITION_DATA {
17088 pub const ENCODED_LEN: usize = 60usize;
17089 pub const DEFAULT: Self = Self {
17090 latitude: 0_i32,
17091 longitude: 0_i32,
17092 altitude: 0_i32,
17093 x: 0.0_f32,
17094 y: 0.0_f32,
17095 z: 0.0_f32,
17096 q: [0.0_f32; 4usize],
17097 approach_x: 0.0_f32,
17098 approach_y: 0.0_f32,
17099 approach_z: 0.0_f32,
17100 time_usec: 0_u64,
17101 };
17102 #[cfg(feature = "arbitrary")]
17103 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17104 use arbitrary::{Arbitrary, Unstructured};
17105 let mut buf = [0u8; 1024];
17106 rng.fill_bytes(&mut buf);
17107 let mut unstructured = Unstructured::new(&buf);
17108 Self::arbitrary(&mut unstructured).unwrap_or_default()
17109 }
17110}
17111impl Default for HOME_POSITION_DATA {
17112 fn default() -> Self {
17113 Self::DEFAULT.clone()
17114 }
17115}
17116impl MessageData for HOME_POSITION_DATA {
17117 type Message = MavMessage;
17118 const ID: u32 = 242u32;
17119 const NAME: &'static str = "HOME_POSITION";
17120 const EXTRA_CRC: u8 = 104u8;
17121 const ENCODED_LEN: usize = 60usize;
17122 fn deser(
17123 _version: MavlinkVersion,
17124 __input: &[u8],
17125 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17126 let avail_len = __input.len();
17127 let mut payload_buf = [0; Self::ENCODED_LEN];
17128 let mut buf = if avail_len < Self::ENCODED_LEN {
17129 payload_buf[0..avail_len].copy_from_slice(__input);
17130 Bytes::new(&payload_buf)
17131 } else {
17132 Bytes::new(__input)
17133 };
17134 let mut __struct = Self::default();
17135 __struct.latitude = buf.get_i32_le();
17136 __struct.longitude = buf.get_i32_le();
17137 __struct.altitude = buf.get_i32_le();
17138 __struct.x = buf.get_f32_le();
17139 __struct.y = buf.get_f32_le();
17140 __struct.z = buf.get_f32_le();
17141 for v in &mut __struct.q {
17142 let val = buf.get_f32_le();
17143 *v = val;
17144 }
17145 __struct.approach_x = buf.get_f32_le();
17146 __struct.approach_y = buf.get_f32_le();
17147 __struct.approach_z = buf.get_f32_le();
17148 __struct.time_usec = buf.get_u64_le();
17149 Ok(__struct)
17150 }
17151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17152 let mut __tmp = BytesMut::new(bytes);
17153 #[allow(clippy::absurd_extreme_comparisons)]
17154 #[allow(unused_comparisons)]
17155 if __tmp.remaining() < Self::ENCODED_LEN {
17156 panic!(
17157 "buffer is too small (need {} bytes, but got {})",
17158 Self::ENCODED_LEN,
17159 __tmp.remaining(),
17160 )
17161 }
17162 __tmp.put_i32_le(self.latitude);
17163 __tmp.put_i32_le(self.longitude);
17164 __tmp.put_i32_le(self.altitude);
17165 __tmp.put_f32_le(self.x);
17166 __tmp.put_f32_le(self.y);
17167 __tmp.put_f32_le(self.z);
17168 for val in &self.q {
17169 __tmp.put_f32_le(*val);
17170 }
17171 __tmp.put_f32_le(self.approach_x);
17172 __tmp.put_f32_le(self.approach_y);
17173 __tmp.put_f32_le(self.approach_z);
17174 if matches!(version, MavlinkVersion::V2) {
17175 __tmp.put_u64_le(self.time_usec);
17176 let len = __tmp.len();
17177 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17178 } else {
17179 __tmp.len()
17180 }
17181 }
17182}
17183#[doc = "Temperature and humidity from hygrometer."]
17184#[doc = ""]
17185#[doc = "ID: 12920"]
17186#[derive(Debug, Clone, PartialEq)]
17187#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17189#[cfg_attr(feature = "ts", derive(TS))]
17190#[cfg_attr(feature = "ts", ts(export))]
17191pub struct HYGROMETER_SENSOR_DATA {
17192 #[doc = "Temperature"]
17193 pub temperature: i16,
17194 #[doc = "Humidity"]
17195 pub humidity: u16,
17196 #[doc = "Hygrometer ID"]
17197 pub id: u8,
17198}
17199impl HYGROMETER_SENSOR_DATA {
17200 pub const ENCODED_LEN: usize = 5usize;
17201 pub const DEFAULT: Self = Self {
17202 temperature: 0_i16,
17203 humidity: 0_u16,
17204 id: 0_u8,
17205 };
17206 #[cfg(feature = "arbitrary")]
17207 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17208 use arbitrary::{Arbitrary, Unstructured};
17209 let mut buf = [0u8; 1024];
17210 rng.fill_bytes(&mut buf);
17211 let mut unstructured = Unstructured::new(&buf);
17212 Self::arbitrary(&mut unstructured).unwrap_or_default()
17213 }
17214}
17215impl Default for HYGROMETER_SENSOR_DATA {
17216 fn default() -> Self {
17217 Self::DEFAULT.clone()
17218 }
17219}
17220impl MessageData for HYGROMETER_SENSOR_DATA {
17221 type Message = MavMessage;
17222 const ID: u32 = 12920u32;
17223 const NAME: &'static str = "HYGROMETER_SENSOR";
17224 const EXTRA_CRC: u8 = 20u8;
17225 const ENCODED_LEN: usize = 5usize;
17226 fn deser(
17227 _version: MavlinkVersion,
17228 __input: &[u8],
17229 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17230 let avail_len = __input.len();
17231 let mut payload_buf = [0; Self::ENCODED_LEN];
17232 let mut buf = if avail_len < Self::ENCODED_LEN {
17233 payload_buf[0..avail_len].copy_from_slice(__input);
17234 Bytes::new(&payload_buf)
17235 } else {
17236 Bytes::new(__input)
17237 };
17238 let mut __struct = Self::default();
17239 __struct.temperature = buf.get_i16_le();
17240 __struct.humidity = buf.get_u16_le();
17241 __struct.id = buf.get_u8();
17242 Ok(__struct)
17243 }
17244 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17245 let mut __tmp = BytesMut::new(bytes);
17246 #[allow(clippy::absurd_extreme_comparisons)]
17247 #[allow(unused_comparisons)]
17248 if __tmp.remaining() < Self::ENCODED_LEN {
17249 panic!(
17250 "buffer is too small (need {} bytes, but got {})",
17251 Self::ENCODED_LEN,
17252 __tmp.remaining(),
17253 )
17254 }
17255 __tmp.put_i16_le(self.temperature);
17256 __tmp.put_u16_le(self.humidity);
17257 __tmp.put_u8(self.id);
17258 if matches!(version, MavlinkVersion::V2) {
17259 let len = __tmp.len();
17260 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17261 } else {
17262 __tmp.len()
17263 }
17264 }
17265}
17266#[doc = "Illuminator status."]
17267#[doc = ""]
17268#[doc = "ID: 440"]
17269#[derive(Debug, Clone, PartialEq)]
17270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17272#[cfg_attr(feature = "ts", derive(TS))]
17273#[cfg_attr(feature = "ts", ts(export))]
17274pub struct ILLUMINATOR_STATUS_DATA {
17275 #[doc = "Time since the start-up of the illuminator in ms"]
17276 pub uptime_ms: u32,
17277 #[doc = "Errors"]
17278 pub error_status: IlluminatorErrorFlags,
17279 #[doc = "Illuminator brightness"]
17280 pub brightness: f32,
17281 #[doc = "Illuminator strobing period in seconds"]
17282 pub strobe_period: f32,
17283 #[doc = "Illuminator strobing duty cycle"]
17284 pub strobe_duty_cycle: f32,
17285 #[doc = "Temperature in Celsius"]
17286 pub temp_c: f32,
17287 #[doc = "Minimum strobing period in seconds"]
17288 pub min_strobe_period: f32,
17289 #[doc = "Maximum strobing period in seconds"]
17290 pub max_strobe_period: f32,
17291 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17292 pub enable: u8,
17293 #[doc = "Supported illuminator modes"]
17294 pub mode_bitmask: IlluminatorMode,
17295 #[doc = "Illuminator mode"]
17296 pub mode: IlluminatorMode,
17297}
17298impl ILLUMINATOR_STATUS_DATA {
17299 pub const ENCODED_LEN: usize = 35usize;
17300 pub const DEFAULT: Self = Self {
17301 uptime_ms: 0_u32,
17302 error_status: IlluminatorErrorFlags::DEFAULT,
17303 brightness: 0.0_f32,
17304 strobe_period: 0.0_f32,
17305 strobe_duty_cycle: 0.0_f32,
17306 temp_c: 0.0_f32,
17307 min_strobe_period: 0.0_f32,
17308 max_strobe_period: 0.0_f32,
17309 enable: 0_u8,
17310 mode_bitmask: IlluminatorMode::DEFAULT,
17311 mode: IlluminatorMode::DEFAULT,
17312 };
17313 #[cfg(feature = "arbitrary")]
17314 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17315 use arbitrary::{Arbitrary, Unstructured};
17316 let mut buf = [0u8; 1024];
17317 rng.fill_bytes(&mut buf);
17318 let mut unstructured = Unstructured::new(&buf);
17319 Self::arbitrary(&mut unstructured).unwrap_or_default()
17320 }
17321}
17322impl Default for ILLUMINATOR_STATUS_DATA {
17323 fn default() -> Self {
17324 Self::DEFAULT.clone()
17325 }
17326}
17327impl MessageData for ILLUMINATOR_STATUS_DATA {
17328 type Message = MavMessage;
17329 const ID: u32 = 440u32;
17330 const NAME: &'static str = "ILLUMINATOR_STATUS";
17331 const EXTRA_CRC: u8 = 66u8;
17332 const ENCODED_LEN: usize = 35usize;
17333 fn deser(
17334 _version: MavlinkVersion,
17335 __input: &[u8],
17336 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17337 let avail_len = __input.len();
17338 let mut payload_buf = [0; Self::ENCODED_LEN];
17339 let mut buf = if avail_len < Self::ENCODED_LEN {
17340 payload_buf[0..avail_len].copy_from_slice(__input);
17341 Bytes::new(&payload_buf)
17342 } else {
17343 Bytes::new(__input)
17344 };
17345 let mut __struct = Self::default();
17346 __struct.uptime_ms = buf.get_u32_le();
17347 let tmp = buf.get_u32_le();
17348 __struct.error_status = IlluminatorErrorFlags::from_bits(
17349 tmp & IlluminatorErrorFlags::all().bits(),
17350 )
17351 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17352 flag_type: "IlluminatorErrorFlags",
17353 value: tmp as u32,
17354 })?;
17355 __struct.brightness = buf.get_f32_le();
17356 __struct.strobe_period = buf.get_f32_le();
17357 __struct.strobe_duty_cycle = buf.get_f32_le();
17358 __struct.temp_c = buf.get_f32_le();
17359 __struct.min_strobe_period = buf.get_f32_le();
17360 __struct.max_strobe_period = buf.get_f32_le();
17361 __struct.enable = buf.get_u8();
17362 let tmp = buf.get_u8();
17363 __struct.mode_bitmask =
17364 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17365 enum_type: "IlluminatorMode",
17366 value: tmp as u32,
17367 })?;
17368 let tmp = buf.get_u8();
17369 __struct.mode =
17370 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17371 enum_type: "IlluminatorMode",
17372 value: tmp as u32,
17373 })?;
17374 Ok(__struct)
17375 }
17376 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17377 let mut __tmp = BytesMut::new(bytes);
17378 #[allow(clippy::absurd_extreme_comparisons)]
17379 #[allow(unused_comparisons)]
17380 if __tmp.remaining() < Self::ENCODED_LEN {
17381 panic!(
17382 "buffer is too small (need {} bytes, but got {})",
17383 Self::ENCODED_LEN,
17384 __tmp.remaining(),
17385 )
17386 }
17387 __tmp.put_u32_le(self.uptime_ms);
17388 __tmp.put_u32_le(self.error_status.bits());
17389 __tmp.put_f32_le(self.brightness);
17390 __tmp.put_f32_le(self.strobe_period);
17391 __tmp.put_f32_le(self.strobe_duty_cycle);
17392 __tmp.put_f32_le(self.temp_c);
17393 __tmp.put_f32_le(self.min_strobe_period);
17394 __tmp.put_f32_le(self.max_strobe_period);
17395 __tmp.put_u8(self.enable);
17396 __tmp.put_u8(self.mode_bitmask as u8);
17397 __tmp.put_u8(self.mode as u8);
17398 if matches!(version, MavlinkVersion::V2) {
17399 let len = __tmp.len();
17400 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17401 } else {
17402 __tmp.len()
17403 }
17404 }
17405}
17406#[doc = "Status of the Iridium SBD link."]
17407#[doc = ""]
17408#[doc = "ID: 335"]
17409#[derive(Debug, Clone, PartialEq)]
17410#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17411#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17412#[cfg_attr(feature = "ts", derive(TS))]
17413#[cfg_attr(feature = "ts", ts(export))]
17414pub struct ISBD_LINK_STATUS_DATA {
17415 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17416 pub timestamp: u64,
17417 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17418 pub last_heartbeat: u64,
17419 #[doc = "Number of failed SBD sessions."]
17420 pub failed_sessions: u16,
17421 #[doc = "Number of successful SBD sessions."]
17422 pub successful_sessions: u16,
17423 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17424 pub signal_quality: u8,
17425 #[doc = "1: Ring call pending, 0: No call pending."]
17426 pub ring_pending: u8,
17427 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17428 pub tx_session_pending: u8,
17429 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17430 pub rx_session_pending: u8,
17431}
17432impl ISBD_LINK_STATUS_DATA {
17433 pub const ENCODED_LEN: usize = 24usize;
17434 pub const DEFAULT: Self = Self {
17435 timestamp: 0_u64,
17436 last_heartbeat: 0_u64,
17437 failed_sessions: 0_u16,
17438 successful_sessions: 0_u16,
17439 signal_quality: 0_u8,
17440 ring_pending: 0_u8,
17441 tx_session_pending: 0_u8,
17442 rx_session_pending: 0_u8,
17443 };
17444 #[cfg(feature = "arbitrary")]
17445 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17446 use arbitrary::{Arbitrary, Unstructured};
17447 let mut buf = [0u8; 1024];
17448 rng.fill_bytes(&mut buf);
17449 let mut unstructured = Unstructured::new(&buf);
17450 Self::arbitrary(&mut unstructured).unwrap_or_default()
17451 }
17452}
17453impl Default for ISBD_LINK_STATUS_DATA {
17454 fn default() -> Self {
17455 Self::DEFAULT.clone()
17456 }
17457}
17458impl MessageData for ISBD_LINK_STATUS_DATA {
17459 type Message = MavMessage;
17460 const ID: u32 = 335u32;
17461 const NAME: &'static str = "ISBD_LINK_STATUS";
17462 const EXTRA_CRC: u8 = 225u8;
17463 const ENCODED_LEN: usize = 24usize;
17464 fn deser(
17465 _version: MavlinkVersion,
17466 __input: &[u8],
17467 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17468 let avail_len = __input.len();
17469 let mut payload_buf = [0; Self::ENCODED_LEN];
17470 let mut buf = if avail_len < Self::ENCODED_LEN {
17471 payload_buf[0..avail_len].copy_from_slice(__input);
17472 Bytes::new(&payload_buf)
17473 } else {
17474 Bytes::new(__input)
17475 };
17476 let mut __struct = Self::default();
17477 __struct.timestamp = buf.get_u64_le();
17478 __struct.last_heartbeat = buf.get_u64_le();
17479 __struct.failed_sessions = buf.get_u16_le();
17480 __struct.successful_sessions = buf.get_u16_le();
17481 __struct.signal_quality = buf.get_u8();
17482 __struct.ring_pending = buf.get_u8();
17483 __struct.tx_session_pending = buf.get_u8();
17484 __struct.rx_session_pending = buf.get_u8();
17485 Ok(__struct)
17486 }
17487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17488 let mut __tmp = BytesMut::new(bytes);
17489 #[allow(clippy::absurd_extreme_comparisons)]
17490 #[allow(unused_comparisons)]
17491 if __tmp.remaining() < Self::ENCODED_LEN {
17492 panic!(
17493 "buffer is too small (need {} bytes, but got {})",
17494 Self::ENCODED_LEN,
17495 __tmp.remaining(),
17496 )
17497 }
17498 __tmp.put_u64_le(self.timestamp);
17499 __tmp.put_u64_le(self.last_heartbeat);
17500 __tmp.put_u16_le(self.failed_sessions);
17501 __tmp.put_u16_le(self.successful_sessions);
17502 __tmp.put_u8(self.signal_quality);
17503 __tmp.put_u8(self.ring_pending);
17504 __tmp.put_u8(self.tx_session_pending);
17505 __tmp.put_u8(self.rx_session_pending);
17506 if matches!(version, MavlinkVersion::V2) {
17507 let len = __tmp.len();
17508 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17509 } else {
17510 __tmp.len()
17511 }
17512 }
17513}
17514#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17515#[doc = ""]
17516#[doc = "ID: 149"]
17517#[derive(Debug, Clone, PartialEq)]
17518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17519#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17520#[cfg_attr(feature = "ts", derive(TS))]
17521#[cfg_attr(feature = "ts", ts(export))]
17522pub struct LANDING_TARGET_DATA {
17523 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17524 pub time_usec: u64,
17525 #[doc = "X-axis angular offset of the target from the center of the image"]
17526 pub angle_x: f32,
17527 #[doc = "Y-axis angular offset of the target from the center of the image"]
17528 pub angle_y: f32,
17529 #[doc = "Distance to the target from the vehicle"]
17530 pub distance: f32,
17531 #[doc = "Size of target along x-axis"]
17532 pub size_x: f32,
17533 #[doc = "Size of target along y-axis"]
17534 pub size_y: f32,
17535 #[doc = "The ID of the target if multiple targets are present"]
17536 pub target_num: u8,
17537 #[doc = "Coordinate frame used for following fields."]
17538 pub frame: MavFrame,
17539 #[doc = "X Position of the landing target in MAV_FRAME"]
17540 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17541 pub x: f32,
17542 #[doc = "Y Position of the landing target in MAV_FRAME"]
17543 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17544 pub y: f32,
17545 #[doc = "Z Position of the landing target in MAV_FRAME"]
17546 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17547 pub z: f32,
17548 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17549 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17550 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17551 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17552 pub q: [f32; 4],
17553 #[doc = "Type of landing target"]
17554 #[cfg_attr(feature = "serde", serde(default))]
17555 pub mavtype: LandingTargetType,
17556 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17557 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17558 pub position_valid: u8,
17559}
17560impl LANDING_TARGET_DATA {
17561 pub const ENCODED_LEN: usize = 60usize;
17562 pub const DEFAULT: Self = Self {
17563 time_usec: 0_u64,
17564 angle_x: 0.0_f32,
17565 angle_y: 0.0_f32,
17566 distance: 0.0_f32,
17567 size_x: 0.0_f32,
17568 size_y: 0.0_f32,
17569 target_num: 0_u8,
17570 frame: MavFrame::DEFAULT,
17571 x: 0.0_f32,
17572 y: 0.0_f32,
17573 z: 0.0_f32,
17574 q: [0.0_f32; 4usize],
17575 mavtype: LandingTargetType::DEFAULT,
17576 position_valid: 0_u8,
17577 };
17578 #[cfg(feature = "arbitrary")]
17579 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17580 use arbitrary::{Arbitrary, Unstructured};
17581 let mut buf = [0u8; 1024];
17582 rng.fill_bytes(&mut buf);
17583 let mut unstructured = Unstructured::new(&buf);
17584 Self::arbitrary(&mut unstructured).unwrap_or_default()
17585 }
17586}
17587impl Default for LANDING_TARGET_DATA {
17588 fn default() -> Self {
17589 Self::DEFAULT.clone()
17590 }
17591}
17592impl MessageData for LANDING_TARGET_DATA {
17593 type Message = MavMessage;
17594 const ID: u32 = 149u32;
17595 const NAME: &'static str = "LANDING_TARGET";
17596 const EXTRA_CRC: u8 = 200u8;
17597 const ENCODED_LEN: usize = 60usize;
17598 fn deser(
17599 _version: MavlinkVersion,
17600 __input: &[u8],
17601 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17602 let avail_len = __input.len();
17603 let mut payload_buf = [0; Self::ENCODED_LEN];
17604 let mut buf = if avail_len < Self::ENCODED_LEN {
17605 payload_buf[0..avail_len].copy_from_slice(__input);
17606 Bytes::new(&payload_buf)
17607 } else {
17608 Bytes::new(__input)
17609 };
17610 let mut __struct = Self::default();
17611 __struct.time_usec = buf.get_u64_le();
17612 __struct.angle_x = buf.get_f32_le();
17613 __struct.angle_y = buf.get_f32_le();
17614 __struct.distance = buf.get_f32_le();
17615 __struct.size_x = buf.get_f32_le();
17616 __struct.size_y = buf.get_f32_le();
17617 __struct.target_num = buf.get_u8();
17618 let tmp = buf.get_u8();
17619 __struct.frame =
17620 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17621 enum_type: "MavFrame",
17622 value: tmp as u32,
17623 })?;
17624 __struct.x = buf.get_f32_le();
17625 __struct.y = buf.get_f32_le();
17626 __struct.z = buf.get_f32_le();
17627 for v in &mut __struct.q {
17628 let val = buf.get_f32_le();
17629 *v = val;
17630 }
17631 let tmp = buf.get_u8();
17632 __struct.mavtype =
17633 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17634 enum_type: "LandingTargetType",
17635 value: tmp as u32,
17636 })?;
17637 __struct.position_valid = buf.get_u8();
17638 Ok(__struct)
17639 }
17640 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17641 let mut __tmp = BytesMut::new(bytes);
17642 #[allow(clippy::absurd_extreme_comparisons)]
17643 #[allow(unused_comparisons)]
17644 if __tmp.remaining() < Self::ENCODED_LEN {
17645 panic!(
17646 "buffer is too small (need {} bytes, but got {})",
17647 Self::ENCODED_LEN,
17648 __tmp.remaining(),
17649 )
17650 }
17651 __tmp.put_u64_le(self.time_usec);
17652 __tmp.put_f32_le(self.angle_x);
17653 __tmp.put_f32_le(self.angle_y);
17654 __tmp.put_f32_le(self.distance);
17655 __tmp.put_f32_le(self.size_x);
17656 __tmp.put_f32_le(self.size_y);
17657 __tmp.put_u8(self.target_num);
17658 __tmp.put_u8(self.frame as u8);
17659 if matches!(version, MavlinkVersion::V2) {
17660 __tmp.put_f32_le(self.x);
17661 __tmp.put_f32_le(self.y);
17662 __tmp.put_f32_le(self.z);
17663 for val in &self.q {
17664 __tmp.put_f32_le(*val);
17665 }
17666 __tmp.put_u8(self.mavtype as u8);
17667 __tmp.put_u8(self.position_valid);
17668 let len = __tmp.len();
17669 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17670 } else {
17671 __tmp.len()
17672 }
17673 }
17674}
17675#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17676#[doc = ""]
17677#[doc = "ID: 8"]
17678#[derive(Debug, Clone, PartialEq)]
17679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17681#[cfg_attr(feature = "ts", derive(TS))]
17682#[cfg_attr(feature = "ts", ts(export))]
17683pub struct LINK_NODE_STATUS_DATA {
17684 #[doc = "Timestamp (time since system boot)."]
17685 pub timestamp: u64,
17686 #[doc = "Transmit rate"]
17687 pub tx_rate: u32,
17688 #[doc = "Receive rate"]
17689 pub rx_rate: u32,
17690 #[doc = "Messages sent"]
17691 pub messages_sent: u32,
17692 #[doc = "Messages received (estimated from counting seq)"]
17693 pub messages_received: u32,
17694 #[doc = "Messages lost (estimated from counting seq)"]
17695 pub messages_lost: u32,
17696 #[doc = "Number of bytes that could not be parsed correctly."]
17697 pub rx_parse_err: u16,
17698 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17699 pub tx_overflows: u16,
17700 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17701 pub rx_overflows: u16,
17702 #[doc = "Remaining free transmit buffer space"]
17703 pub tx_buf: u8,
17704 #[doc = "Remaining free receive buffer space"]
17705 pub rx_buf: u8,
17706}
17707impl LINK_NODE_STATUS_DATA {
17708 pub const ENCODED_LEN: usize = 36usize;
17709 pub const DEFAULT: Self = Self {
17710 timestamp: 0_u64,
17711 tx_rate: 0_u32,
17712 rx_rate: 0_u32,
17713 messages_sent: 0_u32,
17714 messages_received: 0_u32,
17715 messages_lost: 0_u32,
17716 rx_parse_err: 0_u16,
17717 tx_overflows: 0_u16,
17718 rx_overflows: 0_u16,
17719 tx_buf: 0_u8,
17720 rx_buf: 0_u8,
17721 };
17722 #[cfg(feature = "arbitrary")]
17723 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17724 use arbitrary::{Arbitrary, Unstructured};
17725 let mut buf = [0u8; 1024];
17726 rng.fill_bytes(&mut buf);
17727 let mut unstructured = Unstructured::new(&buf);
17728 Self::arbitrary(&mut unstructured).unwrap_or_default()
17729 }
17730}
17731impl Default for LINK_NODE_STATUS_DATA {
17732 fn default() -> Self {
17733 Self::DEFAULT.clone()
17734 }
17735}
17736impl MessageData for LINK_NODE_STATUS_DATA {
17737 type Message = MavMessage;
17738 const ID: u32 = 8u32;
17739 const NAME: &'static str = "LINK_NODE_STATUS";
17740 const EXTRA_CRC: u8 = 117u8;
17741 const ENCODED_LEN: usize = 36usize;
17742 fn deser(
17743 _version: MavlinkVersion,
17744 __input: &[u8],
17745 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17746 let avail_len = __input.len();
17747 let mut payload_buf = [0; Self::ENCODED_LEN];
17748 let mut buf = if avail_len < Self::ENCODED_LEN {
17749 payload_buf[0..avail_len].copy_from_slice(__input);
17750 Bytes::new(&payload_buf)
17751 } else {
17752 Bytes::new(__input)
17753 };
17754 let mut __struct = Self::default();
17755 __struct.timestamp = buf.get_u64_le();
17756 __struct.tx_rate = buf.get_u32_le();
17757 __struct.rx_rate = buf.get_u32_le();
17758 __struct.messages_sent = buf.get_u32_le();
17759 __struct.messages_received = buf.get_u32_le();
17760 __struct.messages_lost = buf.get_u32_le();
17761 __struct.rx_parse_err = buf.get_u16_le();
17762 __struct.tx_overflows = buf.get_u16_le();
17763 __struct.rx_overflows = buf.get_u16_le();
17764 __struct.tx_buf = buf.get_u8();
17765 __struct.rx_buf = buf.get_u8();
17766 Ok(__struct)
17767 }
17768 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17769 let mut __tmp = BytesMut::new(bytes);
17770 #[allow(clippy::absurd_extreme_comparisons)]
17771 #[allow(unused_comparisons)]
17772 if __tmp.remaining() < Self::ENCODED_LEN {
17773 panic!(
17774 "buffer is too small (need {} bytes, but got {})",
17775 Self::ENCODED_LEN,
17776 __tmp.remaining(),
17777 )
17778 }
17779 __tmp.put_u64_le(self.timestamp);
17780 __tmp.put_u32_le(self.tx_rate);
17781 __tmp.put_u32_le(self.rx_rate);
17782 __tmp.put_u32_le(self.messages_sent);
17783 __tmp.put_u32_le(self.messages_received);
17784 __tmp.put_u32_le(self.messages_lost);
17785 __tmp.put_u16_le(self.rx_parse_err);
17786 __tmp.put_u16_le(self.tx_overflows);
17787 __tmp.put_u16_le(self.rx_overflows);
17788 __tmp.put_u8(self.tx_buf);
17789 __tmp.put_u8(self.rx_buf);
17790 if matches!(version, MavlinkVersion::V2) {
17791 let len = __tmp.len();
17792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17793 } else {
17794 __tmp.len()
17795 }
17796 }
17797}
17798#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17799#[doc = ""]
17800#[doc = "ID: 32"]
17801#[derive(Debug, Clone, PartialEq)]
17802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17804#[cfg_attr(feature = "ts", derive(TS))]
17805#[cfg_attr(feature = "ts", ts(export))]
17806pub struct LOCAL_POSITION_NED_DATA {
17807 #[doc = "Timestamp (time since system boot)."]
17808 pub time_boot_ms: u32,
17809 #[doc = "X Position"]
17810 pub x: f32,
17811 #[doc = "Y Position"]
17812 pub y: f32,
17813 #[doc = "Z Position"]
17814 pub z: f32,
17815 #[doc = "X Speed"]
17816 pub vx: f32,
17817 #[doc = "Y Speed"]
17818 pub vy: f32,
17819 #[doc = "Z Speed"]
17820 pub vz: f32,
17821}
17822impl LOCAL_POSITION_NED_DATA {
17823 pub const ENCODED_LEN: usize = 28usize;
17824 pub const DEFAULT: Self = Self {
17825 time_boot_ms: 0_u32,
17826 x: 0.0_f32,
17827 y: 0.0_f32,
17828 z: 0.0_f32,
17829 vx: 0.0_f32,
17830 vy: 0.0_f32,
17831 vz: 0.0_f32,
17832 };
17833 #[cfg(feature = "arbitrary")]
17834 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17835 use arbitrary::{Arbitrary, Unstructured};
17836 let mut buf = [0u8; 1024];
17837 rng.fill_bytes(&mut buf);
17838 let mut unstructured = Unstructured::new(&buf);
17839 Self::arbitrary(&mut unstructured).unwrap_or_default()
17840 }
17841}
17842impl Default for LOCAL_POSITION_NED_DATA {
17843 fn default() -> Self {
17844 Self::DEFAULT.clone()
17845 }
17846}
17847impl MessageData for LOCAL_POSITION_NED_DATA {
17848 type Message = MavMessage;
17849 const ID: u32 = 32u32;
17850 const NAME: &'static str = "LOCAL_POSITION_NED";
17851 const EXTRA_CRC: u8 = 185u8;
17852 const ENCODED_LEN: usize = 28usize;
17853 fn deser(
17854 _version: MavlinkVersion,
17855 __input: &[u8],
17856 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17857 let avail_len = __input.len();
17858 let mut payload_buf = [0; Self::ENCODED_LEN];
17859 let mut buf = if avail_len < Self::ENCODED_LEN {
17860 payload_buf[0..avail_len].copy_from_slice(__input);
17861 Bytes::new(&payload_buf)
17862 } else {
17863 Bytes::new(__input)
17864 };
17865 let mut __struct = Self::default();
17866 __struct.time_boot_ms = buf.get_u32_le();
17867 __struct.x = buf.get_f32_le();
17868 __struct.y = buf.get_f32_le();
17869 __struct.z = buf.get_f32_le();
17870 __struct.vx = buf.get_f32_le();
17871 __struct.vy = buf.get_f32_le();
17872 __struct.vz = buf.get_f32_le();
17873 Ok(__struct)
17874 }
17875 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17876 let mut __tmp = BytesMut::new(bytes);
17877 #[allow(clippy::absurd_extreme_comparisons)]
17878 #[allow(unused_comparisons)]
17879 if __tmp.remaining() < Self::ENCODED_LEN {
17880 panic!(
17881 "buffer is too small (need {} bytes, but got {})",
17882 Self::ENCODED_LEN,
17883 __tmp.remaining(),
17884 )
17885 }
17886 __tmp.put_u32_le(self.time_boot_ms);
17887 __tmp.put_f32_le(self.x);
17888 __tmp.put_f32_le(self.y);
17889 __tmp.put_f32_le(self.z);
17890 __tmp.put_f32_le(self.vx);
17891 __tmp.put_f32_le(self.vy);
17892 __tmp.put_f32_le(self.vz);
17893 if matches!(version, MavlinkVersion::V2) {
17894 let len = __tmp.len();
17895 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17896 } else {
17897 __tmp.len()
17898 }
17899 }
17900}
17901#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17902#[doc = ""]
17903#[doc = "ID: 64"]
17904#[derive(Debug, Clone, PartialEq)]
17905#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17907#[cfg_attr(feature = "ts", derive(TS))]
17908#[cfg_attr(feature = "ts", ts(export))]
17909pub struct LOCAL_POSITION_NED_COV_DATA {
17910 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17911 pub time_usec: u64,
17912 #[doc = "X Position"]
17913 pub x: f32,
17914 #[doc = "Y Position"]
17915 pub y: f32,
17916 #[doc = "Z Position"]
17917 pub z: f32,
17918 #[doc = "X Speed"]
17919 pub vx: f32,
17920 #[doc = "Y Speed"]
17921 pub vy: f32,
17922 #[doc = "Z Speed"]
17923 pub vz: f32,
17924 #[doc = "X Acceleration"]
17925 pub ax: f32,
17926 #[doc = "Y Acceleration"]
17927 pub ay: f32,
17928 #[doc = "Z Acceleration"]
17929 pub az: f32,
17930 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17931 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17932 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17933 pub covariance: [f32; 45],
17934 #[doc = "Class id of the estimator this estimate originated from."]
17935 pub estimator_type: MavEstimatorType,
17936}
17937impl LOCAL_POSITION_NED_COV_DATA {
17938 pub const ENCODED_LEN: usize = 225usize;
17939 pub const DEFAULT: Self = Self {
17940 time_usec: 0_u64,
17941 x: 0.0_f32,
17942 y: 0.0_f32,
17943 z: 0.0_f32,
17944 vx: 0.0_f32,
17945 vy: 0.0_f32,
17946 vz: 0.0_f32,
17947 ax: 0.0_f32,
17948 ay: 0.0_f32,
17949 az: 0.0_f32,
17950 covariance: [0.0_f32; 45usize],
17951 estimator_type: MavEstimatorType::DEFAULT,
17952 };
17953 #[cfg(feature = "arbitrary")]
17954 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17955 use arbitrary::{Arbitrary, Unstructured};
17956 let mut buf = [0u8; 1024];
17957 rng.fill_bytes(&mut buf);
17958 let mut unstructured = Unstructured::new(&buf);
17959 Self::arbitrary(&mut unstructured).unwrap_or_default()
17960 }
17961}
17962impl Default for LOCAL_POSITION_NED_COV_DATA {
17963 fn default() -> Self {
17964 Self::DEFAULT.clone()
17965 }
17966}
17967impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17968 type Message = MavMessage;
17969 const ID: u32 = 64u32;
17970 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17971 const EXTRA_CRC: u8 = 191u8;
17972 const ENCODED_LEN: usize = 225usize;
17973 fn deser(
17974 _version: MavlinkVersion,
17975 __input: &[u8],
17976 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17977 let avail_len = __input.len();
17978 let mut payload_buf = [0; Self::ENCODED_LEN];
17979 let mut buf = if avail_len < Self::ENCODED_LEN {
17980 payload_buf[0..avail_len].copy_from_slice(__input);
17981 Bytes::new(&payload_buf)
17982 } else {
17983 Bytes::new(__input)
17984 };
17985 let mut __struct = Self::default();
17986 __struct.time_usec = buf.get_u64_le();
17987 __struct.x = buf.get_f32_le();
17988 __struct.y = buf.get_f32_le();
17989 __struct.z = buf.get_f32_le();
17990 __struct.vx = buf.get_f32_le();
17991 __struct.vy = buf.get_f32_le();
17992 __struct.vz = buf.get_f32_le();
17993 __struct.ax = buf.get_f32_le();
17994 __struct.ay = buf.get_f32_le();
17995 __struct.az = buf.get_f32_le();
17996 for v in &mut __struct.covariance {
17997 let val = buf.get_f32_le();
17998 *v = val;
17999 }
18000 let tmp = buf.get_u8();
18001 __struct.estimator_type =
18002 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18003 enum_type: "MavEstimatorType",
18004 value: tmp as u32,
18005 })?;
18006 Ok(__struct)
18007 }
18008 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18009 let mut __tmp = BytesMut::new(bytes);
18010 #[allow(clippy::absurd_extreme_comparisons)]
18011 #[allow(unused_comparisons)]
18012 if __tmp.remaining() < Self::ENCODED_LEN {
18013 panic!(
18014 "buffer is too small (need {} bytes, but got {})",
18015 Self::ENCODED_LEN,
18016 __tmp.remaining(),
18017 )
18018 }
18019 __tmp.put_u64_le(self.time_usec);
18020 __tmp.put_f32_le(self.x);
18021 __tmp.put_f32_le(self.y);
18022 __tmp.put_f32_le(self.z);
18023 __tmp.put_f32_le(self.vx);
18024 __tmp.put_f32_le(self.vy);
18025 __tmp.put_f32_le(self.vz);
18026 __tmp.put_f32_le(self.ax);
18027 __tmp.put_f32_le(self.ay);
18028 __tmp.put_f32_le(self.az);
18029 for val in &self.covariance {
18030 __tmp.put_f32_le(*val);
18031 }
18032 __tmp.put_u8(self.estimator_type as u8);
18033 if matches!(version, MavlinkVersion::V2) {
18034 let len = __tmp.len();
18035 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18036 } else {
18037 __tmp.len()
18038 }
18039 }
18040}
18041#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18042#[doc = ""]
18043#[doc = "ID: 89"]
18044#[derive(Debug, Clone, PartialEq)]
18045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18047#[cfg_attr(feature = "ts", derive(TS))]
18048#[cfg_attr(feature = "ts", ts(export))]
18049pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18050 #[doc = "Timestamp (time since system boot)."]
18051 pub time_boot_ms: u32,
18052 #[doc = "X Position"]
18053 pub x: f32,
18054 #[doc = "Y Position"]
18055 pub y: f32,
18056 #[doc = "Z Position"]
18057 pub z: f32,
18058 #[doc = "Roll"]
18059 pub roll: f32,
18060 #[doc = "Pitch"]
18061 pub pitch: f32,
18062 #[doc = "Yaw"]
18063 pub yaw: f32,
18064}
18065impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18066 pub const ENCODED_LEN: usize = 28usize;
18067 pub const DEFAULT: Self = Self {
18068 time_boot_ms: 0_u32,
18069 x: 0.0_f32,
18070 y: 0.0_f32,
18071 z: 0.0_f32,
18072 roll: 0.0_f32,
18073 pitch: 0.0_f32,
18074 yaw: 0.0_f32,
18075 };
18076 #[cfg(feature = "arbitrary")]
18077 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18078 use arbitrary::{Arbitrary, Unstructured};
18079 let mut buf = [0u8; 1024];
18080 rng.fill_bytes(&mut buf);
18081 let mut unstructured = Unstructured::new(&buf);
18082 Self::arbitrary(&mut unstructured).unwrap_or_default()
18083 }
18084}
18085impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18086 fn default() -> Self {
18087 Self::DEFAULT.clone()
18088 }
18089}
18090impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18091 type Message = MavMessage;
18092 const ID: u32 = 89u32;
18093 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
18094 const EXTRA_CRC: u8 = 231u8;
18095 const ENCODED_LEN: usize = 28usize;
18096 fn deser(
18097 _version: MavlinkVersion,
18098 __input: &[u8],
18099 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18100 let avail_len = __input.len();
18101 let mut payload_buf = [0; Self::ENCODED_LEN];
18102 let mut buf = if avail_len < Self::ENCODED_LEN {
18103 payload_buf[0..avail_len].copy_from_slice(__input);
18104 Bytes::new(&payload_buf)
18105 } else {
18106 Bytes::new(__input)
18107 };
18108 let mut __struct = Self::default();
18109 __struct.time_boot_ms = buf.get_u32_le();
18110 __struct.x = buf.get_f32_le();
18111 __struct.y = buf.get_f32_le();
18112 __struct.z = buf.get_f32_le();
18113 __struct.roll = buf.get_f32_le();
18114 __struct.pitch = buf.get_f32_le();
18115 __struct.yaw = buf.get_f32_le();
18116 Ok(__struct)
18117 }
18118 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18119 let mut __tmp = BytesMut::new(bytes);
18120 #[allow(clippy::absurd_extreme_comparisons)]
18121 #[allow(unused_comparisons)]
18122 if __tmp.remaining() < Self::ENCODED_LEN {
18123 panic!(
18124 "buffer is too small (need {} bytes, but got {})",
18125 Self::ENCODED_LEN,
18126 __tmp.remaining(),
18127 )
18128 }
18129 __tmp.put_u32_le(self.time_boot_ms);
18130 __tmp.put_f32_le(self.x);
18131 __tmp.put_f32_le(self.y);
18132 __tmp.put_f32_le(self.z);
18133 __tmp.put_f32_le(self.roll);
18134 __tmp.put_f32_le(self.pitch);
18135 __tmp.put_f32_le(self.yaw);
18136 if matches!(version, MavlinkVersion::V2) {
18137 let len = __tmp.len();
18138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18139 } else {
18140 __tmp.len()
18141 }
18142 }
18143}
18144#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18145#[doc = ""]
18146#[doc = "ID: 268"]
18147#[derive(Debug, Clone, PartialEq)]
18148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18150#[cfg_attr(feature = "ts", derive(TS))]
18151#[cfg_attr(feature = "ts", ts(export))]
18152pub struct LOGGING_ACK_DATA {
18153 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18154 pub sequence: u16,
18155 #[doc = "system ID of the target"]
18156 pub target_system: u8,
18157 #[doc = "component ID of the target"]
18158 pub target_component: u8,
18159}
18160impl LOGGING_ACK_DATA {
18161 pub const ENCODED_LEN: usize = 4usize;
18162 pub const DEFAULT: Self = Self {
18163 sequence: 0_u16,
18164 target_system: 0_u8,
18165 target_component: 0_u8,
18166 };
18167 #[cfg(feature = "arbitrary")]
18168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18169 use arbitrary::{Arbitrary, Unstructured};
18170 let mut buf = [0u8; 1024];
18171 rng.fill_bytes(&mut buf);
18172 let mut unstructured = Unstructured::new(&buf);
18173 Self::arbitrary(&mut unstructured).unwrap_or_default()
18174 }
18175}
18176impl Default for LOGGING_ACK_DATA {
18177 fn default() -> Self {
18178 Self::DEFAULT.clone()
18179 }
18180}
18181impl MessageData for LOGGING_ACK_DATA {
18182 type Message = MavMessage;
18183 const ID: u32 = 268u32;
18184 const NAME: &'static str = "LOGGING_ACK";
18185 const EXTRA_CRC: u8 = 14u8;
18186 const ENCODED_LEN: usize = 4usize;
18187 fn deser(
18188 _version: MavlinkVersion,
18189 __input: &[u8],
18190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18191 let avail_len = __input.len();
18192 let mut payload_buf = [0; Self::ENCODED_LEN];
18193 let mut buf = if avail_len < Self::ENCODED_LEN {
18194 payload_buf[0..avail_len].copy_from_slice(__input);
18195 Bytes::new(&payload_buf)
18196 } else {
18197 Bytes::new(__input)
18198 };
18199 let mut __struct = Self::default();
18200 __struct.sequence = buf.get_u16_le();
18201 __struct.target_system = buf.get_u8();
18202 __struct.target_component = buf.get_u8();
18203 Ok(__struct)
18204 }
18205 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18206 let mut __tmp = BytesMut::new(bytes);
18207 #[allow(clippy::absurd_extreme_comparisons)]
18208 #[allow(unused_comparisons)]
18209 if __tmp.remaining() < Self::ENCODED_LEN {
18210 panic!(
18211 "buffer is too small (need {} bytes, but got {})",
18212 Self::ENCODED_LEN,
18213 __tmp.remaining(),
18214 )
18215 }
18216 __tmp.put_u16_le(self.sequence);
18217 __tmp.put_u8(self.target_system);
18218 __tmp.put_u8(self.target_component);
18219 if matches!(version, MavlinkVersion::V2) {
18220 let len = __tmp.len();
18221 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18222 } else {
18223 __tmp.len()
18224 }
18225 }
18226}
18227#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18228#[doc = ""]
18229#[doc = "ID: 266"]
18230#[derive(Debug, Clone, PartialEq)]
18231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18233#[cfg_attr(feature = "ts", derive(TS))]
18234#[cfg_attr(feature = "ts", ts(export))]
18235pub struct LOGGING_DATA_DATA {
18236 #[doc = "sequence number (can wrap)"]
18237 pub sequence: u16,
18238 #[doc = "system ID of the target"]
18239 pub target_system: u8,
18240 #[doc = "component ID of the target"]
18241 pub target_component: u8,
18242 #[doc = "data length"]
18243 pub length: u8,
18244 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18245 pub first_message_offset: u8,
18246 #[doc = "logged data"]
18247 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18248 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18249 pub data: [u8; 249],
18250}
18251impl LOGGING_DATA_DATA {
18252 pub const ENCODED_LEN: usize = 255usize;
18253 pub const DEFAULT: Self = Self {
18254 sequence: 0_u16,
18255 target_system: 0_u8,
18256 target_component: 0_u8,
18257 length: 0_u8,
18258 first_message_offset: 0_u8,
18259 data: [0_u8; 249usize],
18260 };
18261 #[cfg(feature = "arbitrary")]
18262 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18263 use arbitrary::{Arbitrary, Unstructured};
18264 let mut buf = [0u8; 1024];
18265 rng.fill_bytes(&mut buf);
18266 let mut unstructured = Unstructured::new(&buf);
18267 Self::arbitrary(&mut unstructured).unwrap_or_default()
18268 }
18269}
18270impl Default for LOGGING_DATA_DATA {
18271 fn default() -> Self {
18272 Self::DEFAULT.clone()
18273 }
18274}
18275impl MessageData for LOGGING_DATA_DATA {
18276 type Message = MavMessage;
18277 const ID: u32 = 266u32;
18278 const NAME: &'static str = "LOGGING_DATA";
18279 const EXTRA_CRC: u8 = 193u8;
18280 const ENCODED_LEN: usize = 255usize;
18281 fn deser(
18282 _version: MavlinkVersion,
18283 __input: &[u8],
18284 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18285 let avail_len = __input.len();
18286 let mut payload_buf = [0; Self::ENCODED_LEN];
18287 let mut buf = if avail_len < Self::ENCODED_LEN {
18288 payload_buf[0..avail_len].copy_from_slice(__input);
18289 Bytes::new(&payload_buf)
18290 } else {
18291 Bytes::new(__input)
18292 };
18293 let mut __struct = Self::default();
18294 __struct.sequence = buf.get_u16_le();
18295 __struct.target_system = buf.get_u8();
18296 __struct.target_component = buf.get_u8();
18297 __struct.length = buf.get_u8();
18298 __struct.first_message_offset = buf.get_u8();
18299 for v in &mut __struct.data {
18300 let val = buf.get_u8();
18301 *v = val;
18302 }
18303 Ok(__struct)
18304 }
18305 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18306 let mut __tmp = BytesMut::new(bytes);
18307 #[allow(clippy::absurd_extreme_comparisons)]
18308 #[allow(unused_comparisons)]
18309 if __tmp.remaining() < Self::ENCODED_LEN {
18310 panic!(
18311 "buffer is too small (need {} bytes, but got {})",
18312 Self::ENCODED_LEN,
18313 __tmp.remaining(),
18314 )
18315 }
18316 __tmp.put_u16_le(self.sequence);
18317 __tmp.put_u8(self.target_system);
18318 __tmp.put_u8(self.target_component);
18319 __tmp.put_u8(self.length);
18320 __tmp.put_u8(self.first_message_offset);
18321 for val in &self.data {
18322 __tmp.put_u8(*val);
18323 }
18324 if matches!(version, MavlinkVersion::V2) {
18325 let len = __tmp.len();
18326 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18327 } else {
18328 __tmp.len()
18329 }
18330 }
18331}
18332#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18333#[doc = ""]
18334#[doc = "ID: 267"]
18335#[derive(Debug, Clone, PartialEq)]
18336#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18337#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18338#[cfg_attr(feature = "ts", derive(TS))]
18339#[cfg_attr(feature = "ts", ts(export))]
18340pub struct LOGGING_DATA_ACKED_DATA {
18341 #[doc = "sequence number (can wrap)"]
18342 pub sequence: u16,
18343 #[doc = "system ID of the target"]
18344 pub target_system: u8,
18345 #[doc = "component ID of the target"]
18346 pub target_component: u8,
18347 #[doc = "data length"]
18348 pub length: u8,
18349 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18350 pub first_message_offset: u8,
18351 #[doc = "logged data"]
18352 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18353 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18354 pub data: [u8; 249],
18355}
18356impl LOGGING_DATA_ACKED_DATA {
18357 pub const ENCODED_LEN: usize = 255usize;
18358 pub const DEFAULT: Self = Self {
18359 sequence: 0_u16,
18360 target_system: 0_u8,
18361 target_component: 0_u8,
18362 length: 0_u8,
18363 first_message_offset: 0_u8,
18364 data: [0_u8; 249usize],
18365 };
18366 #[cfg(feature = "arbitrary")]
18367 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18368 use arbitrary::{Arbitrary, Unstructured};
18369 let mut buf = [0u8; 1024];
18370 rng.fill_bytes(&mut buf);
18371 let mut unstructured = Unstructured::new(&buf);
18372 Self::arbitrary(&mut unstructured).unwrap_or_default()
18373 }
18374}
18375impl Default for LOGGING_DATA_ACKED_DATA {
18376 fn default() -> Self {
18377 Self::DEFAULT.clone()
18378 }
18379}
18380impl MessageData for LOGGING_DATA_ACKED_DATA {
18381 type Message = MavMessage;
18382 const ID: u32 = 267u32;
18383 const NAME: &'static str = "LOGGING_DATA_ACKED";
18384 const EXTRA_CRC: u8 = 35u8;
18385 const ENCODED_LEN: usize = 255usize;
18386 fn deser(
18387 _version: MavlinkVersion,
18388 __input: &[u8],
18389 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18390 let avail_len = __input.len();
18391 let mut payload_buf = [0; Self::ENCODED_LEN];
18392 let mut buf = if avail_len < Self::ENCODED_LEN {
18393 payload_buf[0..avail_len].copy_from_slice(__input);
18394 Bytes::new(&payload_buf)
18395 } else {
18396 Bytes::new(__input)
18397 };
18398 let mut __struct = Self::default();
18399 __struct.sequence = buf.get_u16_le();
18400 __struct.target_system = buf.get_u8();
18401 __struct.target_component = buf.get_u8();
18402 __struct.length = buf.get_u8();
18403 __struct.first_message_offset = buf.get_u8();
18404 for v in &mut __struct.data {
18405 let val = buf.get_u8();
18406 *v = val;
18407 }
18408 Ok(__struct)
18409 }
18410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18411 let mut __tmp = BytesMut::new(bytes);
18412 #[allow(clippy::absurd_extreme_comparisons)]
18413 #[allow(unused_comparisons)]
18414 if __tmp.remaining() < Self::ENCODED_LEN {
18415 panic!(
18416 "buffer is too small (need {} bytes, but got {})",
18417 Self::ENCODED_LEN,
18418 __tmp.remaining(),
18419 )
18420 }
18421 __tmp.put_u16_le(self.sequence);
18422 __tmp.put_u8(self.target_system);
18423 __tmp.put_u8(self.target_component);
18424 __tmp.put_u8(self.length);
18425 __tmp.put_u8(self.first_message_offset);
18426 for val in &self.data {
18427 __tmp.put_u8(*val);
18428 }
18429 if matches!(version, MavlinkVersion::V2) {
18430 let len = __tmp.len();
18431 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18432 } else {
18433 __tmp.len()
18434 }
18435 }
18436}
18437#[doc = "Reply to LOG_REQUEST_DATA."]
18438#[doc = ""]
18439#[doc = "ID: 120"]
18440#[derive(Debug, Clone, PartialEq)]
18441#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18442#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18443#[cfg_attr(feature = "ts", derive(TS))]
18444#[cfg_attr(feature = "ts", ts(export))]
18445pub struct LOG_DATA_DATA {
18446 #[doc = "Offset into the log"]
18447 pub ofs: u32,
18448 #[doc = "Log id (from LOG_ENTRY reply)"]
18449 pub id: u16,
18450 #[doc = "Number of bytes (zero for end of log)"]
18451 pub count: u8,
18452 #[doc = "log data"]
18453 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18454 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18455 pub data: [u8; 90],
18456}
18457impl LOG_DATA_DATA {
18458 pub const ENCODED_LEN: usize = 97usize;
18459 pub const DEFAULT: Self = Self {
18460 ofs: 0_u32,
18461 id: 0_u16,
18462 count: 0_u8,
18463 data: [0_u8; 90usize],
18464 };
18465 #[cfg(feature = "arbitrary")]
18466 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18467 use arbitrary::{Arbitrary, Unstructured};
18468 let mut buf = [0u8; 1024];
18469 rng.fill_bytes(&mut buf);
18470 let mut unstructured = Unstructured::new(&buf);
18471 Self::arbitrary(&mut unstructured).unwrap_or_default()
18472 }
18473}
18474impl Default for LOG_DATA_DATA {
18475 fn default() -> Self {
18476 Self::DEFAULT.clone()
18477 }
18478}
18479impl MessageData for LOG_DATA_DATA {
18480 type Message = MavMessage;
18481 const ID: u32 = 120u32;
18482 const NAME: &'static str = "LOG_DATA";
18483 const EXTRA_CRC: u8 = 134u8;
18484 const ENCODED_LEN: usize = 97usize;
18485 fn deser(
18486 _version: MavlinkVersion,
18487 __input: &[u8],
18488 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18489 let avail_len = __input.len();
18490 let mut payload_buf = [0; Self::ENCODED_LEN];
18491 let mut buf = if avail_len < Self::ENCODED_LEN {
18492 payload_buf[0..avail_len].copy_from_slice(__input);
18493 Bytes::new(&payload_buf)
18494 } else {
18495 Bytes::new(__input)
18496 };
18497 let mut __struct = Self::default();
18498 __struct.ofs = buf.get_u32_le();
18499 __struct.id = buf.get_u16_le();
18500 __struct.count = buf.get_u8();
18501 for v in &mut __struct.data {
18502 let val = buf.get_u8();
18503 *v = val;
18504 }
18505 Ok(__struct)
18506 }
18507 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18508 let mut __tmp = BytesMut::new(bytes);
18509 #[allow(clippy::absurd_extreme_comparisons)]
18510 #[allow(unused_comparisons)]
18511 if __tmp.remaining() < Self::ENCODED_LEN {
18512 panic!(
18513 "buffer is too small (need {} bytes, but got {})",
18514 Self::ENCODED_LEN,
18515 __tmp.remaining(),
18516 )
18517 }
18518 __tmp.put_u32_le(self.ofs);
18519 __tmp.put_u16_le(self.id);
18520 __tmp.put_u8(self.count);
18521 for val in &self.data {
18522 __tmp.put_u8(*val);
18523 }
18524 if matches!(version, MavlinkVersion::V2) {
18525 let len = __tmp.len();
18526 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18527 } else {
18528 __tmp.len()
18529 }
18530 }
18531}
18532#[doc = "Reply to LOG_REQUEST_LIST."]
18533#[doc = ""]
18534#[doc = "ID: 118"]
18535#[derive(Debug, Clone, PartialEq)]
18536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18538#[cfg_attr(feature = "ts", derive(TS))]
18539#[cfg_attr(feature = "ts", ts(export))]
18540pub struct LOG_ENTRY_DATA {
18541 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18542 pub time_utc: u32,
18543 #[doc = "Size of the log (may be approximate)"]
18544 pub size: u32,
18545 #[doc = "Log id"]
18546 pub id: u16,
18547 #[doc = "Total number of logs"]
18548 pub num_logs: u16,
18549 #[doc = "High log number"]
18550 pub last_log_num: u16,
18551}
18552impl LOG_ENTRY_DATA {
18553 pub const ENCODED_LEN: usize = 14usize;
18554 pub const DEFAULT: Self = Self {
18555 time_utc: 0_u32,
18556 size: 0_u32,
18557 id: 0_u16,
18558 num_logs: 0_u16,
18559 last_log_num: 0_u16,
18560 };
18561 #[cfg(feature = "arbitrary")]
18562 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18563 use arbitrary::{Arbitrary, Unstructured};
18564 let mut buf = [0u8; 1024];
18565 rng.fill_bytes(&mut buf);
18566 let mut unstructured = Unstructured::new(&buf);
18567 Self::arbitrary(&mut unstructured).unwrap_or_default()
18568 }
18569}
18570impl Default for LOG_ENTRY_DATA {
18571 fn default() -> Self {
18572 Self::DEFAULT.clone()
18573 }
18574}
18575impl MessageData for LOG_ENTRY_DATA {
18576 type Message = MavMessage;
18577 const ID: u32 = 118u32;
18578 const NAME: &'static str = "LOG_ENTRY";
18579 const EXTRA_CRC: u8 = 56u8;
18580 const ENCODED_LEN: usize = 14usize;
18581 fn deser(
18582 _version: MavlinkVersion,
18583 __input: &[u8],
18584 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18585 let avail_len = __input.len();
18586 let mut payload_buf = [0; Self::ENCODED_LEN];
18587 let mut buf = if avail_len < Self::ENCODED_LEN {
18588 payload_buf[0..avail_len].copy_from_slice(__input);
18589 Bytes::new(&payload_buf)
18590 } else {
18591 Bytes::new(__input)
18592 };
18593 let mut __struct = Self::default();
18594 __struct.time_utc = buf.get_u32_le();
18595 __struct.size = buf.get_u32_le();
18596 __struct.id = buf.get_u16_le();
18597 __struct.num_logs = buf.get_u16_le();
18598 __struct.last_log_num = buf.get_u16_le();
18599 Ok(__struct)
18600 }
18601 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18602 let mut __tmp = BytesMut::new(bytes);
18603 #[allow(clippy::absurd_extreme_comparisons)]
18604 #[allow(unused_comparisons)]
18605 if __tmp.remaining() < Self::ENCODED_LEN {
18606 panic!(
18607 "buffer is too small (need {} bytes, but got {})",
18608 Self::ENCODED_LEN,
18609 __tmp.remaining(),
18610 )
18611 }
18612 __tmp.put_u32_le(self.time_utc);
18613 __tmp.put_u32_le(self.size);
18614 __tmp.put_u16_le(self.id);
18615 __tmp.put_u16_le(self.num_logs);
18616 __tmp.put_u16_le(self.last_log_num);
18617 if matches!(version, MavlinkVersion::V2) {
18618 let len = __tmp.len();
18619 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18620 } else {
18621 __tmp.len()
18622 }
18623 }
18624}
18625#[doc = "Erase all logs."]
18626#[doc = ""]
18627#[doc = "ID: 121"]
18628#[derive(Debug, Clone, PartialEq)]
18629#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18630#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18631#[cfg_attr(feature = "ts", derive(TS))]
18632#[cfg_attr(feature = "ts", ts(export))]
18633pub struct LOG_ERASE_DATA {
18634 #[doc = "System ID"]
18635 pub target_system: u8,
18636 #[doc = "Component ID"]
18637 pub target_component: u8,
18638}
18639impl LOG_ERASE_DATA {
18640 pub const ENCODED_LEN: usize = 2usize;
18641 pub const DEFAULT: Self = Self {
18642 target_system: 0_u8,
18643 target_component: 0_u8,
18644 };
18645 #[cfg(feature = "arbitrary")]
18646 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18647 use arbitrary::{Arbitrary, Unstructured};
18648 let mut buf = [0u8; 1024];
18649 rng.fill_bytes(&mut buf);
18650 let mut unstructured = Unstructured::new(&buf);
18651 Self::arbitrary(&mut unstructured).unwrap_or_default()
18652 }
18653}
18654impl Default for LOG_ERASE_DATA {
18655 fn default() -> Self {
18656 Self::DEFAULT.clone()
18657 }
18658}
18659impl MessageData for LOG_ERASE_DATA {
18660 type Message = MavMessage;
18661 const ID: u32 = 121u32;
18662 const NAME: &'static str = "LOG_ERASE";
18663 const EXTRA_CRC: u8 = 237u8;
18664 const ENCODED_LEN: usize = 2usize;
18665 fn deser(
18666 _version: MavlinkVersion,
18667 __input: &[u8],
18668 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18669 let avail_len = __input.len();
18670 let mut payload_buf = [0; Self::ENCODED_LEN];
18671 let mut buf = if avail_len < Self::ENCODED_LEN {
18672 payload_buf[0..avail_len].copy_from_slice(__input);
18673 Bytes::new(&payload_buf)
18674 } else {
18675 Bytes::new(__input)
18676 };
18677 let mut __struct = Self::default();
18678 __struct.target_system = buf.get_u8();
18679 __struct.target_component = buf.get_u8();
18680 Ok(__struct)
18681 }
18682 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18683 let mut __tmp = BytesMut::new(bytes);
18684 #[allow(clippy::absurd_extreme_comparisons)]
18685 #[allow(unused_comparisons)]
18686 if __tmp.remaining() < Self::ENCODED_LEN {
18687 panic!(
18688 "buffer is too small (need {} bytes, but got {})",
18689 Self::ENCODED_LEN,
18690 __tmp.remaining(),
18691 )
18692 }
18693 __tmp.put_u8(self.target_system);
18694 __tmp.put_u8(self.target_component);
18695 if matches!(version, MavlinkVersion::V2) {
18696 let len = __tmp.len();
18697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18698 } else {
18699 __tmp.len()
18700 }
18701 }
18702}
18703#[doc = "Request a chunk of a log."]
18704#[doc = ""]
18705#[doc = "ID: 119"]
18706#[derive(Debug, Clone, PartialEq)]
18707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18709#[cfg_attr(feature = "ts", derive(TS))]
18710#[cfg_attr(feature = "ts", ts(export))]
18711pub struct LOG_REQUEST_DATA_DATA {
18712 #[doc = "Offset into the log"]
18713 pub ofs: u32,
18714 #[doc = "Number of bytes"]
18715 pub count: u32,
18716 #[doc = "Log id (from LOG_ENTRY reply)"]
18717 pub id: u16,
18718 #[doc = "System ID"]
18719 pub target_system: u8,
18720 #[doc = "Component ID"]
18721 pub target_component: u8,
18722}
18723impl LOG_REQUEST_DATA_DATA {
18724 pub const ENCODED_LEN: usize = 12usize;
18725 pub const DEFAULT: Self = Self {
18726 ofs: 0_u32,
18727 count: 0_u32,
18728 id: 0_u16,
18729 target_system: 0_u8,
18730 target_component: 0_u8,
18731 };
18732 #[cfg(feature = "arbitrary")]
18733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18734 use arbitrary::{Arbitrary, Unstructured};
18735 let mut buf = [0u8; 1024];
18736 rng.fill_bytes(&mut buf);
18737 let mut unstructured = Unstructured::new(&buf);
18738 Self::arbitrary(&mut unstructured).unwrap_or_default()
18739 }
18740}
18741impl Default for LOG_REQUEST_DATA_DATA {
18742 fn default() -> Self {
18743 Self::DEFAULT.clone()
18744 }
18745}
18746impl MessageData for LOG_REQUEST_DATA_DATA {
18747 type Message = MavMessage;
18748 const ID: u32 = 119u32;
18749 const NAME: &'static str = "LOG_REQUEST_DATA";
18750 const EXTRA_CRC: u8 = 116u8;
18751 const ENCODED_LEN: usize = 12usize;
18752 fn deser(
18753 _version: MavlinkVersion,
18754 __input: &[u8],
18755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18756 let avail_len = __input.len();
18757 let mut payload_buf = [0; Self::ENCODED_LEN];
18758 let mut buf = if avail_len < Self::ENCODED_LEN {
18759 payload_buf[0..avail_len].copy_from_slice(__input);
18760 Bytes::new(&payload_buf)
18761 } else {
18762 Bytes::new(__input)
18763 };
18764 let mut __struct = Self::default();
18765 __struct.ofs = buf.get_u32_le();
18766 __struct.count = buf.get_u32_le();
18767 __struct.id = buf.get_u16_le();
18768 __struct.target_system = buf.get_u8();
18769 __struct.target_component = buf.get_u8();
18770 Ok(__struct)
18771 }
18772 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18773 let mut __tmp = BytesMut::new(bytes);
18774 #[allow(clippy::absurd_extreme_comparisons)]
18775 #[allow(unused_comparisons)]
18776 if __tmp.remaining() < Self::ENCODED_LEN {
18777 panic!(
18778 "buffer is too small (need {} bytes, but got {})",
18779 Self::ENCODED_LEN,
18780 __tmp.remaining(),
18781 )
18782 }
18783 __tmp.put_u32_le(self.ofs);
18784 __tmp.put_u32_le(self.count);
18785 __tmp.put_u16_le(self.id);
18786 __tmp.put_u8(self.target_system);
18787 __tmp.put_u8(self.target_component);
18788 if matches!(version, MavlinkVersion::V2) {
18789 let len = __tmp.len();
18790 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18791 } else {
18792 __tmp.len()
18793 }
18794 }
18795}
18796#[doc = "Stop log transfer and resume normal logging."]
18797#[doc = ""]
18798#[doc = "ID: 122"]
18799#[derive(Debug, Clone, PartialEq)]
18800#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18801#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18802#[cfg_attr(feature = "ts", derive(TS))]
18803#[cfg_attr(feature = "ts", ts(export))]
18804pub struct LOG_REQUEST_END_DATA {
18805 #[doc = "System ID"]
18806 pub target_system: u8,
18807 #[doc = "Component ID"]
18808 pub target_component: u8,
18809}
18810impl LOG_REQUEST_END_DATA {
18811 pub const ENCODED_LEN: usize = 2usize;
18812 pub const DEFAULT: Self = Self {
18813 target_system: 0_u8,
18814 target_component: 0_u8,
18815 };
18816 #[cfg(feature = "arbitrary")]
18817 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18818 use arbitrary::{Arbitrary, Unstructured};
18819 let mut buf = [0u8; 1024];
18820 rng.fill_bytes(&mut buf);
18821 let mut unstructured = Unstructured::new(&buf);
18822 Self::arbitrary(&mut unstructured).unwrap_or_default()
18823 }
18824}
18825impl Default for LOG_REQUEST_END_DATA {
18826 fn default() -> Self {
18827 Self::DEFAULT.clone()
18828 }
18829}
18830impl MessageData for LOG_REQUEST_END_DATA {
18831 type Message = MavMessage;
18832 const ID: u32 = 122u32;
18833 const NAME: &'static str = "LOG_REQUEST_END";
18834 const EXTRA_CRC: u8 = 203u8;
18835 const ENCODED_LEN: usize = 2usize;
18836 fn deser(
18837 _version: MavlinkVersion,
18838 __input: &[u8],
18839 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18840 let avail_len = __input.len();
18841 let mut payload_buf = [0; Self::ENCODED_LEN];
18842 let mut buf = if avail_len < Self::ENCODED_LEN {
18843 payload_buf[0..avail_len].copy_from_slice(__input);
18844 Bytes::new(&payload_buf)
18845 } else {
18846 Bytes::new(__input)
18847 };
18848 let mut __struct = Self::default();
18849 __struct.target_system = buf.get_u8();
18850 __struct.target_component = buf.get_u8();
18851 Ok(__struct)
18852 }
18853 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18854 let mut __tmp = BytesMut::new(bytes);
18855 #[allow(clippy::absurd_extreme_comparisons)]
18856 #[allow(unused_comparisons)]
18857 if __tmp.remaining() < Self::ENCODED_LEN {
18858 panic!(
18859 "buffer is too small (need {} bytes, but got {})",
18860 Self::ENCODED_LEN,
18861 __tmp.remaining(),
18862 )
18863 }
18864 __tmp.put_u8(self.target_system);
18865 __tmp.put_u8(self.target_component);
18866 if matches!(version, MavlinkVersion::V2) {
18867 let len = __tmp.len();
18868 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18869 } else {
18870 __tmp.len()
18871 }
18872 }
18873}
18874#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18875#[doc = ""]
18876#[doc = "ID: 117"]
18877#[derive(Debug, Clone, PartialEq)]
18878#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18879#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18880#[cfg_attr(feature = "ts", derive(TS))]
18881#[cfg_attr(feature = "ts", ts(export))]
18882pub struct LOG_REQUEST_LIST_DATA {
18883 #[doc = "First log id (0 for first available)"]
18884 pub start: u16,
18885 #[doc = "Last log id (0xffff for last available)"]
18886 pub end: u16,
18887 #[doc = "System ID"]
18888 pub target_system: u8,
18889 #[doc = "Component ID"]
18890 pub target_component: u8,
18891}
18892impl LOG_REQUEST_LIST_DATA {
18893 pub const ENCODED_LEN: usize = 6usize;
18894 pub const DEFAULT: Self = Self {
18895 start: 0_u16,
18896 end: 0_u16,
18897 target_system: 0_u8,
18898 target_component: 0_u8,
18899 };
18900 #[cfg(feature = "arbitrary")]
18901 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18902 use arbitrary::{Arbitrary, Unstructured};
18903 let mut buf = [0u8; 1024];
18904 rng.fill_bytes(&mut buf);
18905 let mut unstructured = Unstructured::new(&buf);
18906 Self::arbitrary(&mut unstructured).unwrap_or_default()
18907 }
18908}
18909impl Default for LOG_REQUEST_LIST_DATA {
18910 fn default() -> Self {
18911 Self::DEFAULT.clone()
18912 }
18913}
18914impl MessageData for LOG_REQUEST_LIST_DATA {
18915 type Message = MavMessage;
18916 const ID: u32 = 117u32;
18917 const NAME: &'static str = "LOG_REQUEST_LIST";
18918 const EXTRA_CRC: u8 = 128u8;
18919 const ENCODED_LEN: usize = 6usize;
18920 fn deser(
18921 _version: MavlinkVersion,
18922 __input: &[u8],
18923 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18924 let avail_len = __input.len();
18925 let mut payload_buf = [0; Self::ENCODED_LEN];
18926 let mut buf = if avail_len < Self::ENCODED_LEN {
18927 payload_buf[0..avail_len].copy_from_slice(__input);
18928 Bytes::new(&payload_buf)
18929 } else {
18930 Bytes::new(__input)
18931 };
18932 let mut __struct = Self::default();
18933 __struct.start = buf.get_u16_le();
18934 __struct.end = buf.get_u16_le();
18935 __struct.target_system = buf.get_u8();
18936 __struct.target_component = buf.get_u8();
18937 Ok(__struct)
18938 }
18939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18940 let mut __tmp = BytesMut::new(bytes);
18941 #[allow(clippy::absurd_extreme_comparisons)]
18942 #[allow(unused_comparisons)]
18943 if __tmp.remaining() < Self::ENCODED_LEN {
18944 panic!(
18945 "buffer is too small (need {} bytes, but got {})",
18946 Self::ENCODED_LEN,
18947 __tmp.remaining(),
18948 )
18949 }
18950 __tmp.put_u16_le(self.start);
18951 __tmp.put_u16_le(self.end);
18952 __tmp.put_u8(self.target_system);
18953 __tmp.put_u8(self.target_component);
18954 if matches!(version, MavlinkVersion::V2) {
18955 let len = __tmp.len();
18956 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18957 } else {
18958 __tmp.len()
18959 }
18960 }
18961}
18962#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18963#[doc = ""]
18964#[doc = "ID: 192"]
18965#[derive(Debug, Clone, PartialEq)]
18966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18967#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18968#[cfg_attr(feature = "ts", derive(TS))]
18969#[cfg_attr(feature = "ts", ts(export))]
18970pub struct MAG_CAL_REPORT_DATA {
18971 #[doc = "RMS milligauss residuals."]
18972 pub fitness: f32,
18973 #[doc = "X offset."]
18974 pub ofs_x: f32,
18975 #[doc = "Y offset."]
18976 pub ofs_y: f32,
18977 #[doc = "Z offset."]
18978 pub ofs_z: f32,
18979 #[doc = "X diagonal (matrix 11)."]
18980 pub diag_x: f32,
18981 #[doc = "Y diagonal (matrix 22)."]
18982 pub diag_y: f32,
18983 #[doc = "Z diagonal (matrix 33)."]
18984 pub diag_z: f32,
18985 #[doc = "X off-diagonal (matrix 12 and 21)."]
18986 pub offdiag_x: f32,
18987 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18988 pub offdiag_y: f32,
18989 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18990 pub offdiag_z: f32,
18991 #[doc = "Compass being calibrated."]
18992 pub compass_id: u8,
18993 #[doc = "Bitmask of compasses being calibrated."]
18994 pub cal_mask: u8,
18995 #[doc = "Calibration Status."]
18996 pub cal_status: MagCalStatus,
18997 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18998 pub autosaved: u8,
18999 #[doc = "Confidence in orientation (higher is better)."]
19000 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19001 pub orientation_confidence: f32,
19002 #[doc = "orientation before calibration."]
19003 #[cfg_attr(feature = "serde", serde(default))]
19004 pub old_orientation: MavSensorOrientation,
19005 #[doc = "orientation after calibration."]
19006 #[cfg_attr(feature = "serde", serde(default))]
19007 pub new_orientation: MavSensorOrientation,
19008 #[doc = "field radius correction factor"]
19009 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19010 pub scale_factor: f32,
19011}
19012impl MAG_CAL_REPORT_DATA {
19013 pub const ENCODED_LEN: usize = 54usize;
19014 pub const DEFAULT: Self = Self {
19015 fitness: 0.0_f32,
19016 ofs_x: 0.0_f32,
19017 ofs_y: 0.0_f32,
19018 ofs_z: 0.0_f32,
19019 diag_x: 0.0_f32,
19020 diag_y: 0.0_f32,
19021 diag_z: 0.0_f32,
19022 offdiag_x: 0.0_f32,
19023 offdiag_y: 0.0_f32,
19024 offdiag_z: 0.0_f32,
19025 compass_id: 0_u8,
19026 cal_mask: 0_u8,
19027 cal_status: MagCalStatus::DEFAULT,
19028 autosaved: 0_u8,
19029 orientation_confidence: 0.0_f32,
19030 old_orientation: MavSensorOrientation::DEFAULT,
19031 new_orientation: MavSensorOrientation::DEFAULT,
19032 scale_factor: 0.0_f32,
19033 };
19034 #[cfg(feature = "arbitrary")]
19035 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19036 use arbitrary::{Arbitrary, Unstructured};
19037 let mut buf = [0u8; 1024];
19038 rng.fill_bytes(&mut buf);
19039 let mut unstructured = Unstructured::new(&buf);
19040 Self::arbitrary(&mut unstructured).unwrap_or_default()
19041 }
19042}
19043impl Default for MAG_CAL_REPORT_DATA {
19044 fn default() -> Self {
19045 Self::DEFAULT.clone()
19046 }
19047}
19048impl MessageData for MAG_CAL_REPORT_DATA {
19049 type Message = MavMessage;
19050 const ID: u32 = 192u32;
19051 const NAME: &'static str = "MAG_CAL_REPORT";
19052 const EXTRA_CRC: u8 = 36u8;
19053 const ENCODED_LEN: usize = 54usize;
19054 fn deser(
19055 _version: MavlinkVersion,
19056 __input: &[u8],
19057 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19058 let avail_len = __input.len();
19059 let mut payload_buf = [0; Self::ENCODED_LEN];
19060 let mut buf = if avail_len < Self::ENCODED_LEN {
19061 payload_buf[0..avail_len].copy_from_slice(__input);
19062 Bytes::new(&payload_buf)
19063 } else {
19064 Bytes::new(__input)
19065 };
19066 let mut __struct = Self::default();
19067 __struct.fitness = buf.get_f32_le();
19068 __struct.ofs_x = buf.get_f32_le();
19069 __struct.ofs_y = buf.get_f32_le();
19070 __struct.ofs_z = buf.get_f32_le();
19071 __struct.diag_x = buf.get_f32_le();
19072 __struct.diag_y = buf.get_f32_le();
19073 __struct.diag_z = buf.get_f32_le();
19074 __struct.offdiag_x = buf.get_f32_le();
19075 __struct.offdiag_y = buf.get_f32_le();
19076 __struct.offdiag_z = buf.get_f32_le();
19077 __struct.compass_id = buf.get_u8();
19078 __struct.cal_mask = buf.get_u8();
19079 let tmp = buf.get_u8();
19080 __struct.cal_status =
19081 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19082 enum_type: "MagCalStatus",
19083 value: tmp as u32,
19084 })?;
19085 __struct.autosaved = buf.get_u8();
19086 __struct.orientation_confidence = buf.get_f32_le();
19087 let tmp = buf.get_u8();
19088 __struct.old_orientation =
19089 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19090 enum_type: "MavSensorOrientation",
19091 value: tmp as u32,
19092 })?;
19093 let tmp = buf.get_u8();
19094 __struct.new_orientation =
19095 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19096 enum_type: "MavSensorOrientation",
19097 value: tmp as u32,
19098 })?;
19099 __struct.scale_factor = buf.get_f32_le();
19100 Ok(__struct)
19101 }
19102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19103 let mut __tmp = BytesMut::new(bytes);
19104 #[allow(clippy::absurd_extreme_comparisons)]
19105 #[allow(unused_comparisons)]
19106 if __tmp.remaining() < Self::ENCODED_LEN {
19107 panic!(
19108 "buffer is too small (need {} bytes, but got {})",
19109 Self::ENCODED_LEN,
19110 __tmp.remaining(),
19111 )
19112 }
19113 __tmp.put_f32_le(self.fitness);
19114 __tmp.put_f32_le(self.ofs_x);
19115 __tmp.put_f32_le(self.ofs_y);
19116 __tmp.put_f32_le(self.ofs_z);
19117 __tmp.put_f32_le(self.diag_x);
19118 __tmp.put_f32_le(self.diag_y);
19119 __tmp.put_f32_le(self.diag_z);
19120 __tmp.put_f32_le(self.offdiag_x);
19121 __tmp.put_f32_le(self.offdiag_y);
19122 __tmp.put_f32_le(self.offdiag_z);
19123 __tmp.put_u8(self.compass_id);
19124 __tmp.put_u8(self.cal_mask);
19125 __tmp.put_u8(self.cal_status as u8);
19126 __tmp.put_u8(self.autosaved);
19127 if matches!(version, MavlinkVersion::V2) {
19128 __tmp.put_f32_le(self.orientation_confidence);
19129 __tmp.put_u8(self.old_orientation as u8);
19130 __tmp.put_u8(self.new_orientation as u8);
19131 __tmp.put_f32_le(self.scale_factor);
19132 let len = __tmp.len();
19133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19134 } else {
19135 __tmp.len()
19136 }
19137 }
19138}
19139#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19140#[doc = ""]
19141#[doc = "ID: 69"]
19142#[derive(Debug, Clone, PartialEq)]
19143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19145#[cfg_attr(feature = "ts", derive(TS))]
19146#[cfg_attr(feature = "ts", ts(export))]
19147pub struct MANUAL_CONTROL_DATA {
19148 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19149 pub x: i16,
19150 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19151 pub y: i16,
19152 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19153 pub z: i16,
19154 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19155 pub r: i16,
19156 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19157 pub buttons: u16,
19158 #[doc = "The system to be controlled."]
19159 pub target: u8,
19160 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19161 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19162 pub buttons2: u16,
19163 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19164 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19165 pub enabled_extensions: u8,
19166 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19167 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19168 pub s: i16,
19169 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19170 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19171 pub t: i16,
19172 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19173 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19174 pub aux1: i16,
19175 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19176 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19177 pub aux2: i16,
19178 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19179 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19180 pub aux3: i16,
19181 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19182 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19183 pub aux4: i16,
19184 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19185 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19186 pub aux5: i16,
19187 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19188 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19189 pub aux6: i16,
19190}
19191impl MANUAL_CONTROL_DATA {
19192 pub const ENCODED_LEN: usize = 30usize;
19193 pub const DEFAULT: Self = Self {
19194 x: 0_i16,
19195 y: 0_i16,
19196 z: 0_i16,
19197 r: 0_i16,
19198 buttons: 0_u16,
19199 target: 0_u8,
19200 buttons2: 0_u16,
19201 enabled_extensions: 0_u8,
19202 s: 0_i16,
19203 t: 0_i16,
19204 aux1: 0_i16,
19205 aux2: 0_i16,
19206 aux3: 0_i16,
19207 aux4: 0_i16,
19208 aux5: 0_i16,
19209 aux6: 0_i16,
19210 };
19211 #[cfg(feature = "arbitrary")]
19212 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19213 use arbitrary::{Arbitrary, Unstructured};
19214 let mut buf = [0u8; 1024];
19215 rng.fill_bytes(&mut buf);
19216 let mut unstructured = Unstructured::new(&buf);
19217 Self::arbitrary(&mut unstructured).unwrap_or_default()
19218 }
19219}
19220impl Default for MANUAL_CONTROL_DATA {
19221 fn default() -> Self {
19222 Self::DEFAULT.clone()
19223 }
19224}
19225impl MessageData for MANUAL_CONTROL_DATA {
19226 type Message = MavMessage;
19227 const ID: u32 = 69u32;
19228 const NAME: &'static str = "MANUAL_CONTROL";
19229 const EXTRA_CRC: u8 = 243u8;
19230 const ENCODED_LEN: usize = 30usize;
19231 fn deser(
19232 _version: MavlinkVersion,
19233 __input: &[u8],
19234 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19235 let avail_len = __input.len();
19236 let mut payload_buf = [0; Self::ENCODED_LEN];
19237 let mut buf = if avail_len < Self::ENCODED_LEN {
19238 payload_buf[0..avail_len].copy_from_slice(__input);
19239 Bytes::new(&payload_buf)
19240 } else {
19241 Bytes::new(__input)
19242 };
19243 let mut __struct = Self::default();
19244 __struct.x = buf.get_i16_le();
19245 __struct.y = buf.get_i16_le();
19246 __struct.z = buf.get_i16_le();
19247 __struct.r = buf.get_i16_le();
19248 __struct.buttons = buf.get_u16_le();
19249 __struct.target = buf.get_u8();
19250 __struct.buttons2 = buf.get_u16_le();
19251 __struct.enabled_extensions = buf.get_u8();
19252 __struct.s = buf.get_i16_le();
19253 __struct.t = buf.get_i16_le();
19254 __struct.aux1 = buf.get_i16_le();
19255 __struct.aux2 = buf.get_i16_le();
19256 __struct.aux3 = buf.get_i16_le();
19257 __struct.aux4 = buf.get_i16_le();
19258 __struct.aux5 = buf.get_i16_le();
19259 __struct.aux6 = buf.get_i16_le();
19260 Ok(__struct)
19261 }
19262 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19263 let mut __tmp = BytesMut::new(bytes);
19264 #[allow(clippy::absurd_extreme_comparisons)]
19265 #[allow(unused_comparisons)]
19266 if __tmp.remaining() < Self::ENCODED_LEN {
19267 panic!(
19268 "buffer is too small (need {} bytes, but got {})",
19269 Self::ENCODED_LEN,
19270 __tmp.remaining(),
19271 )
19272 }
19273 __tmp.put_i16_le(self.x);
19274 __tmp.put_i16_le(self.y);
19275 __tmp.put_i16_le(self.z);
19276 __tmp.put_i16_le(self.r);
19277 __tmp.put_u16_le(self.buttons);
19278 __tmp.put_u8(self.target);
19279 if matches!(version, MavlinkVersion::V2) {
19280 __tmp.put_u16_le(self.buttons2);
19281 __tmp.put_u8(self.enabled_extensions);
19282 __tmp.put_i16_le(self.s);
19283 __tmp.put_i16_le(self.t);
19284 __tmp.put_i16_le(self.aux1);
19285 __tmp.put_i16_le(self.aux2);
19286 __tmp.put_i16_le(self.aux3);
19287 __tmp.put_i16_le(self.aux4);
19288 __tmp.put_i16_le(self.aux5);
19289 __tmp.put_i16_le(self.aux6);
19290 let len = __tmp.len();
19291 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19292 } else {
19293 __tmp.len()
19294 }
19295 }
19296}
19297#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19298#[doc = ""]
19299#[doc = "ID: 81"]
19300#[derive(Debug, Clone, PartialEq)]
19301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19303#[cfg_attr(feature = "ts", derive(TS))]
19304#[cfg_attr(feature = "ts", ts(export))]
19305pub struct MANUAL_SETPOINT_DATA {
19306 #[doc = "Timestamp (time since system boot)."]
19307 pub time_boot_ms: u32,
19308 #[doc = "Desired roll rate"]
19309 pub roll: f32,
19310 #[doc = "Desired pitch rate"]
19311 pub pitch: f32,
19312 #[doc = "Desired yaw rate"]
19313 pub yaw: f32,
19314 #[doc = "Collective thrust, normalized to 0 .. 1"]
19315 pub thrust: f32,
19316 #[doc = "Flight mode switch position, 0.. 255"]
19317 pub mode_switch: u8,
19318 #[doc = "Override mode switch position, 0.. 255"]
19319 pub manual_override_switch: u8,
19320}
19321impl MANUAL_SETPOINT_DATA {
19322 pub const ENCODED_LEN: usize = 22usize;
19323 pub const DEFAULT: Self = Self {
19324 time_boot_ms: 0_u32,
19325 roll: 0.0_f32,
19326 pitch: 0.0_f32,
19327 yaw: 0.0_f32,
19328 thrust: 0.0_f32,
19329 mode_switch: 0_u8,
19330 manual_override_switch: 0_u8,
19331 };
19332 #[cfg(feature = "arbitrary")]
19333 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19334 use arbitrary::{Arbitrary, Unstructured};
19335 let mut buf = [0u8; 1024];
19336 rng.fill_bytes(&mut buf);
19337 let mut unstructured = Unstructured::new(&buf);
19338 Self::arbitrary(&mut unstructured).unwrap_or_default()
19339 }
19340}
19341impl Default for MANUAL_SETPOINT_DATA {
19342 fn default() -> Self {
19343 Self::DEFAULT.clone()
19344 }
19345}
19346impl MessageData for MANUAL_SETPOINT_DATA {
19347 type Message = MavMessage;
19348 const ID: u32 = 81u32;
19349 const NAME: &'static str = "MANUAL_SETPOINT";
19350 const EXTRA_CRC: u8 = 106u8;
19351 const ENCODED_LEN: usize = 22usize;
19352 fn deser(
19353 _version: MavlinkVersion,
19354 __input: &[u8],
19355 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19356 let avail_len = __input.len();
19357 let mut payload_buf = [0; Self::ENCODED_LEN];
19358 let mut buf = if avail_len < Self::ENCODED_LEN {
19359 payload_buf[0..avail_len].copy_from_slice(__input);
19360 Bytes::new(&payload_buf)
19361 } else {
19362 Bytes::new(__input)
19363 };
19364 let mut __struct = Self::default();
19365 __struct.time_boot_ms = buf.get_u32_le();
19366 __struct.roll = buf.get_f32_le();
19367 __struct.pitch = buf.get_f32_le();
19368 __struct.yaw = buf.get_f32_le();
19369 __struct.thrust = buf.get_f32_le();
19370 __struct.mode_switch = buf.get_u8();
19371 __struct.manual_override_switch = buf.get_u8();
19372 Ok(__struct)
19373 }
19374 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19375 let mut __tmp = BytesMut::new(bytes);
19376 #[allow(clippy::absurd_extreme_comparisons)]
19377 #[allow(unused_comparisons)]
19378 if __tmp.remaining() < Self::ENCODED_LEN {
19379 panic!(
19380 "buffer is too small (need {} bytes, but got {})",
19381 Self::ENCODED_LEN,
19382 __tmp.remaining(),
19383 )
19384 }
19385 __tmp.put_u32_le(self.time_boot_ms);
19386 __tmp.put_f32_le(self.roll);
19387 __tmp.put_f32_le(self.pitch);
19388 __tmp.put_f32_le(self.yaw);
19389 __tmp.put_f32_le(self.thrust);
19390 __tmp.put_u8(self.mode_switch);
19391 __tmp.put_u8(self.manual_override_switch);
19392 if matches!(version, MavlinkVersion::V2) {
19393 let len = __tmp.len();
19394 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19395 } else {
19396 __tmp.len()
19397 }
19398 }
19399}
19400#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19401#[doc = ""]
19402#[doc = "ID: 249"]
19403#[derive(Debug, Clone, PartialEq)]
19404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19406#[cfg_attr(feature = "ts", derive(TS))]
19407#[cfg_attr(feature = "ts", ts(export))]
19408pub struct MEMORY_VECT_DATA {
19409 #[doc = "Starting address of the debug variables"]
19410 pub address: u16,
19411 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19412 pub ver: u8,
19413 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19414 pub mavtype: u8,
19415 #[doc = "Memory contents at specified address"]
19416 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19417 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19418 pub value: [i8; 32],
19419}
19420impl MEMORY_VECT_DATA {
19421 pub const ENCODED_LEN: usize = 36usize;
19422 pub const DEFAULT: Self = Self {
19423 address: 0_u16,
19424 ver: 0_u8,
19425 mavtype: 0_u8,
19426 value: [0_i8; 32usize],
19427 };
19428 #[cfg(feature = "arbitrary")]
19429 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19430 use arbitrary::{Arbitrary, Unstructured};
19431 let mut buf = [0u8; 1024];
19432 rng.fill_bytes(&mut buf);
19433 let mut unstructured = Unstructured::new(&buf);
19434 Self::arbitrary(&mut unstructured).unwrap_or_default()
19435 }
19436}
19437impl Default for MEMORY_VECT_DATA {
19438 fn default() -> Self {
19439 Self::DEFAULT.clone()
19440 }
19441}
19442impl MessageData for MEMORY_VECT_DATA {
19443 type Message = MavMessage;
19444 const ID: u32 = 249u32;
19445 const NAME: &'static str = "MEMORY_VECT";
19446 const EXTRA_CRC: u8 = 204u8;
19447 const ENCODED_LEN: usize = 36usize;
19448 fn deser(
19449 _version: MavlinkVersion,
19450 __input: &[u8],
19451 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19452 let avail_len = __input.len();
19453 let mut payload_buf = [0; Self::ENCODED_LEN];
19454 let mut buf = if avail_len < Self::ENCODED_LEN {
19455 payload_buf[0..avail_len].copy_from_slice(__input);
19456 Bytes::new(&payload_buf)
19457 } else {
19458 Bytes::new(__input)
19459 };
19460 let mut __struct = Self::default();
19461 __struct.address = buf.get_u16_le();
19462 __struct.ver = buf.get_u8();
19463 __struct.mavtype = buf.get_u8();
19464 for v in &mut __struct.value {
19465 let val = buf.get_i8();
19466 *v = val;
19467 }
19468 Ok(__struct)
19469 }
19470 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19471 let mut __tmp = BytesMut::new(bytes);
19472 #[allow(clippy::absurd_extreme_comparisons)]
19473 #[allow(unused_comparisons)]
19474 if __tmp.remaining() < Self::ENCODED_LEN {
19475 panic!(
19476 "buffer is too small (need {} bytes, but got {})",
19477 Self::ENCODED_LEN,
19478 __tmp.remaining(),
19479 )
19480 }
19481 __tmp.put_u16_le(self.address);
19482 __tmp.put_u8(self.ver);
19483 __tmp.put_u8(self.mavtype);
19484 for val in &self.value {
19485 __tmp.put_i8(*val);
19486 }
19487 if matches!(version, MavlinkVersion::V2) {
19488 let len = __tmp.len();
19489 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19490 } else {
19491 __tmp.len()
19492 }
19493 }
19494}
19495#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19496#[doc = ""]
19497#[doc = "ID: 244"]
19498#[derive(Debug, Clone, PartialEq)]
19499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19500#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19501#[cfg_attr(feature = "ts", derive(TS))]
19502#[cfg_attr(feature = "ts", ts(export))]
19503pub struct MESSAGE_INTERVAL_DATA {
19504 #[doc = "0 indicates the interval at which it is sent."]
19505 pub interval_us: i32,
19506 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19507 pub message_id: u16,
19508}
19509impl MESSAGE_INTERVAL_DATA {
19510 pub const ENCODED_LEN: usize = 6usize;
19511 pub const DEFAULT: Self = Self {
19512 interval_us: 0_i32,
19513 message_id: 0_u16,
19514 };
19515 #[cfg(feature = "arbitrary")]
19516 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19517 use arbitrary::{Arbitrary, Unstructured};
19518 let mut buf = [0u8; 1024];
19519 rng.fill_bytes(&mut buf);
19520 let mut unstructured = Unstructured::new(&buf);
19521 Self::arbitrary(&mut unstructured).unwrap_or_default()
19522 }
19523}
19524impl Default for MESSAGE_INTERVAL_DATA {
19525 fn default() -> Self {
19526 Self::DEFAULT.clone()
19527 }
19528}
19529impl MessageData for MESSAGE_INTERVAL_DATA {
19530 type Message = MavMessage;
19531 const ID: u32 = 244u32;
19532 const NAME: &'static str = "MESSAGE_INTERVAL";
19533 const EXTRA_CRC: u8 = 95u8;
19534 const ENCODED_LEN: usize = 6usize;
19535 fn deser(
19536 _version: MavlinkVersion,
19537 __input: &[u8],
19538 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19539 let avail_len = __input.len();
19540 let mut payload_buf = [0; Self::ENCODED_LEN];
19541 let mut buf = if avail_len < Self::ENCODED_LEN {
19542 payload_buf[0..avail_len].copy_from_slice(__input);
19543 Bytes::new(&payload_buf)
19544 } else {
19545 Bytes::new(__input)
19546 };
19547 let mut __struct = Self::default();
19548 __struct.interval_us = buf.get_i32_le();
19549 __struct.message_id = buf.get_u16_le();
19550 Ok(__struct)
19551 }
19552 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19553 let mut __tmp = BytesMut::new(bytes);
19554 #[allow(clippy::absurd_extreme_comparisons)]
19555 #[allow(unused_comparisons)]
19556 if __tmp.remaining() < Self::ENCODED_LEN {
19557 panic!(
19558 "buffer is too small (need {} bytes, but got {})",
19559 Self::ENCODED_LEN,
19560 __tmp.remaining(),
19561 )
19562 }
19563 __tmp.put_i32_le(self.interval_us);
19564 __tmp.put_u16_le(self.message_id);
19565 if matches!(version, MavlinkVersion::V2) {
19566 let len = __tmp.len();
19567 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19568 } else {
19569 __tmp.len()
19570 }
19571 }
19572}
19573#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19574#[doc = ""]
19575#[doc = "ID: 47"]
19576#[derive(Debug, Clone, PartialEq)]
19577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19578#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19579#[cfg_attr(feature = "ts", derive(TS))]
19580#[cfg_attr(feature = "ts", ts(export))]
19581pub struct MISSION_ACK_DATA {
19582 #[doc = "System ID"]
19583 pub target_system: u8,
19584 #[doc = "Component ID"]
19585 pub target_component: u8,
19586 #[doc = "Mission result."]
19587 pub mavtype: MavMissionResult,
19588 #[doc = "Mission type."]
19589 #[cfg_attr(feature = "serde", serde(default))]
19590 pub mission_type: MavMissionType,
19591 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19592 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19593 pub opaque_id: u32,
19594}
19595impl MISSION_ACK_DATA {
19596 pub const ENCODED_LEN: usize = 8usize;
19597 pub const DEFAULT: Self = Self {
19598 target_system: 0_u8,
19599 target_component: 0_u8,
19600 mavtype: MavMissionResult::DEFAULT,
19601 mission_type: MavMissionType::DEFAULT,
19602 opaque_id: 0_u32,
19603 };
19604 #[cfg(feature = "arbitrary")]
19605 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19606 use arbitrary::{Arbitrary, Unstructured};
19607 let mut buf = [0u8; 1024];
19608 rng.fill_bytes(&mut buf);
19609 let mut unstructured = Unstructured::new(&buf);
19610 Self::arbitrary(&mut unstructured).unwrap_or_default()
19611 }
19612}
19613impl Default for MISSION_ACK_DATA {
19614 fn default() -> Self {
19615 Self::DEFAULT.clone()
19616 }
19617}
19618impl MessageData for MISSION_ACK_DATA {
19619 type Message = MavMessage;
19620 const ID: u32 = 47u32;
19621 const NAME: &'static str = "MISSION_ACK";
19622 const EXTRA_CRC: u8 = 153u8;
19623 const ENCODED_LEN: usize = 8usize;
19624 fn deser(
19625 _version: MavlinkVersion,
19626 __input: &[u8],
19627 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19628 let avail_len = __input.len();
19629 let mut payload_buf = [0; Self::ENCODED_LEN];
19630 let mut buf = if avail_len < Self::ENCODED_LEN {
19631 payload_buf[0..avail_len].copy_from_slice(__input);
19632 Bytes::new(&payload_buf)
19633 } else {
19634 Bytes::new(__input)
19635 };
19636 let mut __struct = Self::default();
19637 __struct.target_system = buf.get_u8();
19638 __struct.target_component = buf.get_u8();
19639 let tmp = buf.get_u8();
19640 __struct.mavtype =
19641 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19642 enum_type: "MavMissionResult",
19643 value: tmp as u32,
19644 })?;
19645 let tmp = buf.get_u8();
19646 __struct.mission_type =
19647 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19648 enum_type: "MavMissionType",
19649 value: tmp as u32,
19650 })?;
19651 __struct.opaque_id = buf.get_u32_le();
19652 Ok(__struct)
19653 }
19654 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19655 let mut __tmp = BytesMut::new(bytes);
19656 #[allow(clippy::absurd_extreme_comparisons)]
19657 #[allow(unused_comparisons)]
19658 if __tmp.remaining() < Self::ENCODED_LEN {
19659 panic!(
19660 "buffer is too small (need {} bytes, but got {})",
19661 Self::ENCODED_LEN,
19662 __tmp.remaining(),
19663 )
19664 }
19665 __tmp.put_u8(self.target_system);
19666 __tmp.put_u8(self.target_component);
19667 __tmp.put_u8(self.mavtype as u8);
19668 if matches!(version, MavlinkVersion::V2) {
19669 __tmp.put_u8(self.mission_type as u8);
19670 __tmp.put_u32_le(self.opaque_id);
19671 let len = __tmp.len();
19672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19673 } else {
19674 __tmp.len()
19675 }
19676 }
19677}
19678#[doc = "Delete all mission items at once."]
19679#[doc = ""]
19680#[doc = "ID: 45"]
19681#[derive(Debug, Clone, PartialEq)]
19682#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19683#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19684#[cfg_attr(feature = "ts", derive(TS))]
19685#[cfg_attr(feature = "ts", ts(export))]
19686pub struct MISSION_CLEAR_ALL_DATA {
19687 #[doc = "System ID"]
19688 pub target_system: u8,
19689 #[doc = "Component ID"]
19690 pub target_component: u8,
19691 #[doc = "Mission type."]
19692 #[cfg_attr(feature = "serde", serde(default))]
19693 pub mission_type: MavMissionType,
19694}
19695impl MISSION_CLEAR_ALL_DATA {
19696 pub const ENCODED_LEN: usize = 3usize;
19697 pub const DEFAULT: Self = Self {
19698 target_system: 0_u8,
19699 target_component: 0_u8,
19700 mission_type: MavMissionType::DEFAULT,
19701 };
19702 #[cfg(feature = "arbitrary")]
19703 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19704 use arbitrary::{Arbitrary, Unstructured};
19705 let mut buf = [0u8; 1024];
19706 rng.fill_bytes(&mut buf);
19707 let mut unstructured = Unstructured::new(&buf);
19708 Self::arbitrary(&mut unstructured).unwrap_or_default()
19709 }
19710}
19711impl Default for MISSION_CLEAR_ALL_DATA {
19712 fn default() -> Self {
19713 Self::DEFAULT.clone()
19714 }
19715}
19716impl MessageData for MISSION_CLEAR_ALL_DATA {
19717 type Message = MavMessage;
19718 const ID: u32 = 45u32;
19719 const NAME: &'static str = "MISSION_CLEAR_ALL";
19720 const EXTRA_CRC: u8 = 232u8;
19721 const ENCODED_LEN: usize = 3usize;
19722 fn deser(
19723 _version: MavlinkVersion,
19724 __input: &[u8],
19725 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19726 let avail_len = __input.len();
19727 let mut payload_buf = [0; Self::ENCODED_LEN];
19728 let mut buf = if avail_len < Self::ENCODED_LEN {
19729 payload_buf[0..avail_len].copy_from_slice(__input);
19730 Bytes::new(&payload_buf)
19731 } else {
19732 Bytes::new(__input)
19733 };
19734 let mut __struct = Self::default();
19735 __struct.target_system = buf.get_u8();
19736 __struct.target_component = buf.get_u8();
19737 let tmp = buf.get_u8();
19738 __struct.mission_type =
19739 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19740 enum_type: "MavMissionType",
19741 value: tmp as u32,
19742 })?;
19743 Ok(__struct)
19744 }
19745 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19746 let mut __tmp = BytesMut::new(bytes);
19747 #[allow(clippy::absurd_extreme_comparisons)]
19748 #[allow(unused_comparisons)]
19749 if __tmp.remaining() < Self::ENCODED_LEN {
19750 panic!(
19751 "buffer is too small (need {} bytes, but got {})",
19752 Self::ENCODED_LEN,
19753 __tmp.remaining(),
19754 )
19755 }
19756 __tmp.put_u8(self.target_system);
19757 __tmp.put_u8(self.target_component);
19758 if matches!(version, MavlinkVersion::V2) {
19759 __tmp.put_u8(self.mission_type as u8);
19760 let len = __tmp.len();
19761 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19762 } else {
19763 __tmp.len()
19764 }
19765 }
19766}
19767#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19768#[doc = ""]
19769#[doc = "ID: 44"]
19770#[derive(Debug, Clone, PartialEq)]
19771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19773#[cfg_attr(feature = "ts", derive(TS))]
19774#[cfg_attr(feature = "ts", ts(export))]
19775pub struct MISSION_COUNT_DATA {
19776 #[doc = "Number of mission items in the sequence"]
19777 pub count: u16,
19778 #[doc = "System ID"]
19779 pub target_system: u8,
19780 #[doc = "Component ID"]
19781 pub target_component: u8,
19782 #[doc = "Mission type."]
19783 #[cfg_attr(feature = "serde", serde(default))]
19784 pub mission_type: MavMissionType,
19785 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19786 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19787 pub opaque_id: u32,
19788}
19789impl MISSION_COUNT_DATA {
19790 pub const ENCODED_LEN: usize = 9usize;
19791 pub const DEFAULT: Self = Self {
19792 count: 0_u16,
19793 target_system: 0_u8,
19794 target_component: 0_u8,
19795 mission_type: MavMissionType::DEFAULT,
19796 opaque_id: 0_u32,
19797 };
19798 #[cfg(feature = "arbitrary")]
19799 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19800 use arbitrary::{Arbitrary, Unstructured};
19801 let mut buf = [0u8; 1024];
19802 rng.fill_bytes(&mut buf);
19803 let mut unstructured = Unstructured::new(&buf);
19804 Self::arbitrary(&mut unstructured).unwrap_or_default()
19805 }
19806}
19807impl Default for MISSION_COUNT_DATA {
19808 fn default() -> Self {
19809 Self::DEFAULT.clone()
19810 }
19811}
19812impl MessageData for MISSION_COUNT_DATA {
19813 type Message = MavMessage;
19814 const ID: u32 = 44u32;
19815 const NAME: &'static str = "MISSION_COUNT";
19816 const EXTRA_CRC: u8 = 221u8;
19817 const ENCODED_LEN: usize = 9usize;
19818 fn deser(
19819 _version: MavlinkVersion,
19820 __input: &[u8],
19821 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19822 let avail_len = __input.len();
19823 let mut payload_buf = [0; Self::ENCODED_LEN];
19824 let mut buf = if avail_len < Self::ENCODED_LEN {
19825 payload_buf[0..avail_len].copy_from_slice(__input);
19826 Bytes::new(&payload_buf)
19827 } else {
19828 Bytes::new(__input)
19829 };
19830 let mut __struct = Self::default();
19831 __struct.count = buf.get_u16_le();
19832 __struct.target_system = buf.get_u8();
19833 __struct.target_component = buf.get_u8();
19834 let tmp = buf.get_u8();
19835 __struct.mission_type =
19836 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19837 enum_type: "MavMissionType",
19838 value: tmp as u32,
19839 })?;
19840 __struct.opaque_id = buf.get_u32_le();
19841 Ok(__struct)
19842 }
19843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19844 let mut __tmp = BytesMut::new(bytes);
19845 #[allow(clippy::absurd_extreme_comparisons)]
19846 #[allow(unused_comparisons)]
19847 if __tmp.remaining() < Self::ENCODED_LEN {
19848 panic!(
19849 "buffer is too small (need {} bytes, but got {})",
19850 Self::ENCODED_LEN,
19851 __tmp.remaining(),
19852 )
19853 }
19854 __tmp.put_u16_le(self.count);
19855 __tmp.put_u8(self.target_system);
19856 __tmp.put_u8(self.target_component);
19857 if matches!(version, MavlinkVersion::V2) {
19858 __tmp.put_u8(self.mission_type as u8);
19859 __tmp.put_u32_le(self.opaque_id);
19860 let len = __tmp.len();
19861 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19862 } else {
19863 __tmp.len()
19864 }
19865 }
19866}
19867#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19868#[doc = ""]
19869#[doc = "ID: 42"]
19870#[derive(Debug, Clone, PartialEq)]
19871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19872#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19873#[cfg_attr(feature = "ts", derive(TS))]
19874#[cfg_attr(feature = "ts", ts(export))]
19875pub struct MISSION_CURRENT_DATA {
19876 #[doc = "Sequence"]
19877 pub seq: u16,
19878 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19879 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19880 pub total: u16,
19881 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19882 #[cfg_attr(feature = "serde", serde(default))]
19883 pub mission_state: MissionState,
19884 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19885 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19886 pub mission_mode: u8,
19887 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19888 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19889 pub mission_id: u32,
19890 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19891 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19892 pub fence_id: u32,
19893 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19894 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19895 pub rally_points_id: u32,
19896}
19897impl MISSION_CURRENT_DATA {
19898 pub const ENCODED_LEN: usize = 18usize;
19899 pub const DEFAULT: Self = Self {
19900 seq: 0_u16,
19901 total: 0_u16,
19902 mission_state: MissionState::DEFAULT,
19903 mission_mode: 0_u8,
19904 mission_id: 0_u32,
19905 fence_id: 0_u32,
19906 rally_points_id: 0_u32,
19907 };
19908 #[cfg(feature = "arbitrary")]
19909 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19910 use arbitrary::{Arbitrary, Unstructured};
19911 let mut buf = [0u8; 1024];
19912 rng.fill_bytes(&mut buf);
19913 let mut unstructured = Unstructured::new(&buf);
19914 Self::arbitrary(&mut unstructured).unwrap_or_default()
19915 }
19916}
19917impl Default for MISSION_CURRENT_DATA {
19918 fn default() -> Self {
19919 Self::DEFAULT.clone()
19920 }
19921}
19922impl MessageData for MISSION_CURRENT_DATA {
19923 type Message = MavMessage;
19924 const ID: u32 = 42u32;
19925 const NAME: &'static str = "MISSION_CURRENT";
19926 const EXTRA_CRC: u8 = 28u8;
19927 const ENCODED_LEN: usize = 18usize;
19928 fn deser(
19929 _version: MavlinkVersion,
19930 __input: &[u8],
19931 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19932 let avail_len = __input.len();
19933 let mut payload_buf = [0; Self::ENCODED_LEN];
19934 let mut buf = if avail_len < Self::ENCODED_LEN {
19935 payload_buf[0..avail_len].copy_from_slice(__input);
19936 Bytes::new(&payload_buf)
19937 } else {
19938 Bytes::new(__input)
19939 };
19940 let mut __struct = Self::default();
19941 __struct.seq = buf.get_u16_le();
19942 __struct.total = buf.get_u16_le();
19943 let tmp = buf.get_u8();
19944 __struct.mission_state =
19945 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19946 enum_type: "MissionState",
19947 value: tmp as u32,
19948 })?;
19949 __struct.mission_mode = buf.get_u8();
19950 __struct.mission_id = buf.get_u32_le();
19951 __struct.fence_id = buf.get_u32_le();
19952 __struct.rally_points_id = buf.get_u32_le();
19953 Ok(__struct)
19954 }
19955 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19956 let mut __tmp = BytesMut::new(bytes);
19957 #[allow(clippy::absurd_extreme_comparisons)]
19958 #[allow(unused_comparisons)]
19959 if __tmp.remaining() < Self::ENCODED_LEN {
19960 panic!(
19961 "buffer is too small (need {} bytes, but got {})",
19962 Self::ENCODED_LEN,
19963 __tmp.remaining(),
19964 )
19965 }
19966 __tmp.put_u16_le(self.seq);
19967 if matches!(version, MavlinkVersion::V2) {
19968 __tmp.put_u16_le(self.total);
19969 __tmp.put_u8(self.mission_state as u8);
19970 __tmp.put_u8(self.mission_mode);
19971 __tmp.put_u32_le(self.mission_id);
19972 __tmp.put_u32_le(self.fence_id);
19973 __tmp.put_u32_le(self.rally_points_id);
19974 let len = __tmp.len();
19975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19976 } else {
19977 __tmp.len()
19978 }
19979 }
19980}
19981#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19982#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19983#[doc = ""]
19984#[doc = "ID: 39"]
19985#[derive(Debug, Clone, PartialEq)]
19986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19988#[cfg_attr(feature = "ts", derive(TS))]
19989#[cfg_attr(feature = "ts", ts(export))]
19990pub struct MISSION_ITEM_DATA {
19991 #[doc = "PARAM1, see MAV_CMD enum"]
19992 pub param1: f32,
19993 #[doc = "PARAM2, see MAV_CMD enum"]
19994 pub param2: f32,
19995 #[doc = "PARAM3, see MAV_CMD enum"]
19996 pub param3: f32,
19997 #[doc = "PARAM4, see MAV_CMD enum"]
19998 pub param4: f32,
19999 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
20000 pub x: f32,
20001 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
20002 pub y: f32,
20003 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
20004 pub z: f32,
20005 #[doc = "Sequence"]
20006 pub seq: u16,
20007 #[doc = "The scheduled action for the waypoint."]
20008 pub command: MavCmd,
20009 #[doc = "System ID"]
20010 pub target_system: u8,
20011 #[doc = "Component ID"]
20012 pub target_component: u8,
20013 #[doc = "The coordinate system of the waypoint."]
20014 pub frame: MavFrame,
20015 #[doc = "false:0, true:1"]
20016 pub current: u8,
20017 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20018 pub autocontinue: u8,
20019 #[doc = "Mission type."]
20020 #[cfg_attr(feature = "serde", serde(default))]
20021 pub mission_type: MavMissionType,
20022}
20023impl MISSION_ITEM_DATA {
20024 pub const ENCODED_LEN: usize = 38usize;
20025 pub const DEFAULT: Self = Self {
20026 param1: 0.0_f32,
20027 param2: 0.0_f32,
20028 param3: 0.0_f32,
20029 param4: 0.0_f32,
20030 x: 0.0_f32,
20031 y: 0.0_f32,
20032 z: 0.0_f32,
20033 seq: 0_u16,
20034 command: MavCmd::DEFAULT,
20035 target_system: 0_u8,
20036 target_component: 0_u8,
20037 frame: MavFrame::DEFAULT,
20038 current: 0_u8,
20039 autocontinue: 0_u8,
20040 mission_type: MavMissionType::DEFAULT,
20041 };
20042 #[cfg(feature = "arbitrary")]
20043 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20044 use arbitrary::{Arbitrary, Unstructured};
20045 let mut buf = [0u8; 1024];
20046 rng.fill_bytes(&mut buf);
20047 let mut unstructured = Unstructured::new(&buf);
20048 Self::arbitrary(&mut unstructured).unwrap_or_default()
20049 }
20050}
20051impl Default for MISSION_ITEM_DATA {
20052 fn default() -> Self {
20053 Self::DEFAULT.clone()
20054 }
20055}
20056impl MessageData for MISSION_ITEM_DATA {
20057 type Message = MavMessage;
20058 const ID: u32 = 39u32;
20059 const NAME: &'static str = "MISSION_ITEM";
20060 const EXTRA_CRC: u8 = 254u8;
20061 const ENCODED_LEN: usize = 38usize;
20062 fn deser(
20063 _version: MavlinkVersion,
20064 __input: &[u8],
20065 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20066 let avail_len = __input.len();
20067 let mut payload_buf = [0; Self::ENCODED_LEN];
20068 let mut buf = if avail_len < Self::ENCODED_LEN {
20069 payload_buf[0..avail_len].copy_from_slice(__input);
20070 Bytes::new(&payload_buf)
20071 } else {
20072 Bytes::new(__input)
20073 };
20074 let mut __struct = Self::default();
20075 __struct.param1 = buf.get_f32_le();
20076 __struct.param2 = buf.get_f32_le();
20077 __struct.param3 = buf.get_f32_le();
20078 __struct.param4 = buf.get_f32_le();
20079 __struct.x = buf.get_f32_le();
20080 __struct.y = buf.get_f32_le();
20081 __struct.z = buf.get_f32_le();
20082 __struct.seq = buf.get_u16_le();
20083 let tmp = buf.get_u16_le();
20084 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20085 ::mavlink_core::error::ParserError::InvalidEnum {
20086 enum_type: "MavCmd",
20087 value: tmp as u32,
20088 },
20089 )?;
20090 __struct.target_system = buf.get_u8();
20091 __struct.target_component = buf.get_u8();
20092 let tmp = buf.get_u8();
20093 __struct.frame =
20094 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20095 enum_type: "MavFrame",
20096 value: tmp as u32,
20097 })?;
20098 __struct.current = buf.get_u8();
20099 __struct.autocontinue = buf.get_u8();
20100 let tmp = buf.get_u8();
20101 __struct.mission_type =
20102 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20103 enum_type: "MavMissionType",
20104 value: tmp as u32,
20105 })?;
20106 Ok(__struct)
20107 }
20108 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20109 let mut __tmp = BytesMut::new(bytes);
20110 #[allow(clippy::absurd_extreme_comparisons)]
20111 #[allow(unused_comparisons)]
20112 if __tmp.remaining() < Self::ENCODED_LEN {
20113 panic!(
20114 "buffer is too small (need {} bytes, but got {})",
20115 Self::ENCODED_LEN,
20116 __tmp.remaining(),
20117 )
20118 }
20119 __tmp.put_f32_le(self.param1);
20120 __tmp.put_f32_le(self.param2);
20121 __tmp.put_f32_le(self.param3);
20122 __tmp.put_f32_le(self.param4);
20123 __tmp.put_f32_le(self.x);
20124 __tmp.put_f32_le(self.y);
20125 __tmp.put_f32_le(self.z);
20126 __tmp.put_u16_le(self.seq);
20127 __tmp.put_u16_le(self.command as u16);
20128 __tmp.put_u8(self.target_system);
20129 __tmp.put_u8(self.target_component);
20130 __tmp.put_u8(self.frame as u8);
20131 __tmp.put_u8(self.current);
20132 __tmp.put_u8(self.autocontinue);
20133 if matches!(version, MavlinkVersion::V2) {
20134 __tmp.put_u8(self.mission_type as u8);
20135 let len = __tmp.len();
20136 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20137 } else {
20138 __tmp.len()
20139 }
20140 }
20141}
20142#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20143#[doc = ""]
20144#[doc = "ID: 73"]
20145#[derive(Debug, Clone, PartialEq)]
20146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20147#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20148#[cfg_attr(feature = "ts", derive(TS))]
20149#[cfg_attr(feature = "ts", ts(export))]
20150pub struct MISSION_ITEM_INT_DATA {
20151 #[doc = "PARAM1, see MAV_CMD enum"]
20152 pub param1: f32,
20153 #[doc = "PARAM2, see MAV_CMD enum"]
20154 pub param2: f32,
20155 #[doc = "PARAM3, see MAV_CMD enum"]
20156 pub param3: f32,
20157 #[doc = "PARAM4, see MAV_CMD enum"]
20158 pub param4: f32,
20159 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20160 pub x: i32,
20161 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20162 pub y: i32,
20163 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20164 pub z: f32,
20165 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20166 pub seq: u16,
20167 #[doc = "The scheduled action for the waypoint."]
20168 pub command: MavCmd,
20169 #[doc = "System ID"]
20170 pub target_system: u8,
20171 #[doc = "Component ID"]
20172 pub target_component: u8,
20173 #[doc = "The coordinate system of the waypoint."]
20174 pub frame: MavFrame,
20175 #[doc = "false:0, true:1"]
20176 pub current: u8,
20177 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20178 pub autocontinue: u8,
20179 #[doc = "Mission type."]
20180 #[cfg_attr(feature = "serde", serde(default))]
20181 pub mission_type: MavMissionType,
20182}
20183impl MISSION_ITEM_INT_DATA {
20184 pub const ENCODED_LEN: usize = 38usize;
20185 pub const DEFAULT: Self = Self {
20186 param1: 0.0_f32,
20187 param2: 0.0_f32,
20188 param3: 0.0_f32,
20189 param4: 0.0_f32,
20190 x: 0_i32,
20191 y: 0_i32,
20192 z: 0.0_f32,
20193 seq: 0_u16,
20194 command: MavCmd::DEFAULT,
20195 target_system: 0_u8,
20196 target_component: 0_u8,
20197 frame: MavFrame::DEFAULT,
20198 current: 0_u8,
20199 autocontinue: 0_u8,
20200 mission_type: MavMissionType::DEFAULT,
20201 };
20202 #[cfg(feature = "arbitrary")]
20203 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20204 use arbitrary::{Arbitrary, Unstructured};
20205 let mut buf = [0u8; 1024];
20206 rng.fill_bytes(&mut buf);
20207 let mut unstructured = Unstructured::new(&buf);
20208 Self::arbitrary(&mut unstructured).unwrap_or_default()
20209 }
20210}
20211impl Default for MISSION_ITEM_INT_DATA {
20212 fn default() -> Self {
20213 Self::DEFAULT.clone()
20214 }
20215}
20216impl MessageData for MISSION_ITEM_INT_DATA {
20217 type Message = MavMessage;
20218 const ID: u32 = 73u32;
20219 const NAME: &'static str = "MISSION_ITEM_INT";
20220 const EXTRA_CRC: u8 = 38u8;
20221 const ENCODED_LEN: usize = 38usize;
20222 fn deser(
20223 _version: MavlinkVersion,
20224 __input: &[u8],
20225 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20226 let avail_len = __input.len();
20227 let mut payload_buf = [0; Self::ENCODED_LEN];
20228 let mut buf = if avail_len < Self::ENCODED_LEN {
20229 payload_buf[0..avail_len].copy_from_slice(__input);
20230 Bytes::new(&payload_buf)
20231 } else {
20232 Bytes::new(__input)
20233 };
20234 let mut __struct = Self::default();
20235 __struct.param1 = buf.get_f32_le();
20236 __struct.param2 = buf.get_f32_le();
20237 __struct.param3 = buf.get_f32_le();
20238 __struct.param4 = buf.get_f32_le();
20239 __struct.x = buf.get_i32_le();
20240 __struct.y = buf.get_i32_le();
20241 __struct.z = buf.get_f32_le();
20242 __struct.seq = buf.get_u16_le();
20243 let tmp = buf.get_u16_le();
20244 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20245 ::mavlink_core::error::ParserError::InvalidEnum {
20246 enum_type: "MavCmd",
20247 value: tmp as u32,
20248 },
20249 )?;
20250 __struct.target_system = buf.get_u8();
20251 __struct.target_component = buf.get_u8();
20252 let tmp = buf.get_u8();
20253 __struct.frame =
20254 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20255 enum_type: "MavFrame",
20256 value: tmp as u32,
20257 })?;
20258 __struct.current = buf.get_u8();
20259 __struct.autocontinue = buf.get_u8();
20260 let tmp = buf.get_u8();
20261 __struct.mission_type =
20262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20263 enum_type: "MavMissionType",
20264 value: tmp as u32,
20265 })?;
20266 Ok(__struct)
20267 }
20268 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20269 let mut __tmp = BytesMut::new(bytes);
20270 #[allow(clippy::absurd_extreme_comparisons)]
20271 #[allow(unused_comparisons)]
20272 if __tmp.remaining() < Self::ENCODED_LEN {
20273 panic!(
20274 "buffer is too small (need {} bytes, but got {})",
20275 Self::ENCODED_LEN,
20276 __tmp.remaining(),
20277 )
20278 }
20279 __tmp.put_f32_le(self.param1);
20280 __tmp.put_f32_le(self.param2);
20281 __tmp.put_f32_le(self.param3);
20282 __tmp.put_f32_le(self.param4);
20283 __tmp.put_i32_le(self.x);
20284 __tmp.put_i32_le(self.y);
20285 __tmp.put_f32_le(self.z);
20286 __tmp.put_u16_le(self.seq);
20287 __tmp.put_u16_le(self.command as u16);
20288 __tmp.put_u8(self.target_system);
20289 __tmp.put_u8(self.target_component);
20290 __tmp.put_u8(self.frame as u8);
20291 __tmp.put_u8(self.current);
20292 __tmp.put_u8(self.autocontinue);
20293 if matches!(version, MavlinkVersion::V2) {
20294 __tmp.put_u8(self.mission_type as u8);
20295 let len = __tmp.len();
20296 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20297 } else {
20298 __tmp.len()
20299 }
20300 }
20301}
20302#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20303#[doc = ""]
20304#[doc = "ID: 46"]
20305#[derive(Debug, Clone, PartialEq)]
20306#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20307#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20308#[cfg_attr(feature = "ts", derive(TS))]
20309#[cfg_attr(feature = "ts", ts(export))]
20310pub struct MISSION_ITEM_REACHED_DATA {
20311 #[doc = "Sequence"]
20312 pub seq: u16,
20313}
20314impl MISSION_ITEM_REACHED_DATA {
20315 pub const ENCODED_LEN: usize = 2usize;
20316 pub const DEFAULT: Self = Self { seq: 0_u16 };
20317 #[cfg(feature = "arbitrary")]
20318 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20319 use arbitrary::{Arbitrary, Unstructured};
20320 let mut buf = [0u8; 1024];
20321 rng.fill_bytes(&mut buf);
20322 let mut unstructured = Unstructured::new(&buf);
20323 Self::arbitrary(&mut unstructured).unwrap_or_default()
20324 }
20325}
20326impl Default for MISSION_ITEM_REACHED_DATA {
20327 fn default() -> Self {
20328 Self::DEFAULT.clone()
20329 }
20330}
20331impl MessageData for MISSION_ITEM_REACHED_DATA {
20332 type Message = MavMessage;
20333 const ID: u32 = 46u32;
20334 const NAME: &'static str = "MISSION_ITEM_REACHED";
20335 const EXTRA_CRC: u8 = 11u8;
20336 const ENCODED_LEN: usize = 2usize;
20337 fn deser(
20338 _version: MavlinkVersion,
20339 __input: &[u8],
20340 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20341 let avail_len = __input.len();
20342 let mut payload_buf = [0; Self::ENCODED_LEN];
20343 let mut buf = if avail_len < Self::ENCODED_LEN {
20344 payload_buf[0..avail_len].copy_from_slice(__input);
20345 Bytes::new(&payload_buf)
20346 } else {
20347 Bytes::new(__input)
20348 };
20349 let mut __struct = Self::default();
20350 __struct.seq = buf.get_u16_le();
20351 Ok(__struct)
20352 }
20353 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20354 let mut __tmp = BytesMut::new(bytes);
20355 #[allow(clippy::absurd_extreme_comparisons)]
20356 #[allow(unused_comparisons)]
20357 if __tmp.remaining() < Self::ENCODED_LEN {
20358 panic!(
20359 "buffer is too small (need {} bytes, but got {})",
20360 Self::ENCODED_LEN,
20361 __tmp.remaining(),
20362 )
20363 }
20364 __tmp.put_u16_le(self.seq);
20365 if matches!(version, MavlinkVersion::V2) {
20366 let len = __tmp.len();
20367 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20368 } else {
20369 __tmp.len()
20370 }
20371 }
20372}
20373#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20374#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20375#[doc = ""]
20376#[doc = "ID: 40"]
20377#[derive(Debug, Clone, PartialEq)]
20378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20379#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20380#[cfg_attr(feature = "ts", derive(TS))]
20381#[cfg_attr(feature = "ts", ts(export))]
20382pub struct MISSION_REQUEST_DATA {
20383 #[doc = "Sequence"]
20384 pub seq: u16,
20385 #[doc = "System ID"]
20386 pub target_system: u8,
20387 #[doc = "Component ID"]
20388 pub target_component: u8,
20389 #[doc = "Mission type."]
20390 #[cfg_attr(feature = "serde", serde(default))]
20391 pub mission_type: MavMissionType,
20392}
20393impl MISSION_REQUEST_DATA {
20394 pub const ENCODED_LEN: usize = 5usize;
20395 pub const DEFAULT: Self = Self {
20396 seq: 0_u16,
20397 target_system: 0_u8,
20398 target_component: 0_u8,
20399 mission_type: MavMissionType::DEFAULT,
20400 };
20401 #[cfg(feature = "arbitrary")]
20402 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20403 use arbitrary::{Arbitrary, Unstructured};
20404 let mut buf = [0u8; 1024];
20405 rng.fill_bytes(&mut buf);
20406 let mut unstructured = Unstructured::new(&buf);
20407 Self::arbitrary(&mut unstructured).unwrap_or_default()
20408 }
20409}
20410impl Default for MISSION_REQUEST_DATA {
20411 fn default() -> Self {
20412 Self::DEFAULT.clone()
20413 }
20414}
20415impl MessageData for MISSION_REQUEST_DATA {
20416 type Message = MavMessage;
20417 const ID: u32 = 40u32;
20418 const NAME: &'static str = "MISSION_REQUEST";
20419 const EXTRA_CRC: u8 = 230u8;
20420 const ENCODED_LEN: usize = 5usize;
20421 fn deser(
20422 _version: MavlinkVersion,
20423 __input: &[u8],
20424 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20425 let avail_len = __input.len();
20426 let mut payload_buf = [0; Self::ENCODED_LEN];
20427 let mut buf = if avail_len < Self::ENCODED_LEN {
20428 payload_buf[0..avail_len].copy_from_slice(__input);
20429 Bytes::new(&payload_buf)
20430 } else {
20431 Bytes::new(__input)
20432 };
20433 let mut __struct = Self::default();
20434 __struct.seq = buf.get_u16_le();
20435 __struct.target_system = buf.get_u8();
20436 __struct.target_component = buf.get_u8();
20437 let tmp = buf.get_u8();
20438 __struct.mission_type =
20439 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20440 enum_type: "MavMissionType",
20441 value: tmp as u32,
20442 })?;
20443 Ok(__struct)
20444 }
20445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20446 let mut __tmp = BytesMut::new(bytes);
20447 #[allow(clippy::absurd_extreme_comparisons)]
20448 #[allow(unused_comparisons)]
20449 if __tmp.remaining() < Self::ENCODED_LEN {
20450 panic!(
20451 "buffer is too small (need {} bytes, but got {})",
20452 Self::ENCODED_LEN,
20453 __tmp.remaining(),
20454 )
20455 }
20456 __tmp.put_u16_le(self.seq);
20457 __tmp.put_u8(self.target_system);
20458 __tmp.put_u8(self.target_component);
20459 if matches!(version, MavlinkVersion::V2) {
20460 __tmp.put_u8(self.mission_type as u8);
20461 let len = __tmp.len();
20462 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20463 } else {
20464 __tmp.len()
20465 }
20466 }
20467}
20468#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20469#[doc = ""]
20470#[doc = "ID: 51"]
20471#[derive(Debug, Clone, PartialEq)]
20472#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20473#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20474#[cfg_attr(feature = "ts", derive(TS))]
20475#[cfg_attr(feature = "ts", ts(export))]
20476pub struct MISSION_REQUEST_INT_DATA {
20477 #[doc = "Sequence"]
20478 pub seq: u16,
20479 #[doc = "System ID"]
20480 pub target_system: u8,
20481 #[doc = "Component ID"]
20482 pub target_component: u8,
20483 #[doc = "Mission type."]
20484 #[cfg_attr(feature = "serde", serde(default))]
20485 pub mission_type: MavMissionType,
20486}
20487impl MISSION_REQUEST_INT_DATA {
20488 pub const ENCODED_LEN: usize = 5usize;
20489 pub const DEFAULT: Self = Self {
20490 seq: 0_u16,
20491 target_system: 0_u8,
20492 target_component: 0_u8,
20493 mission_type: MavMissionType::DEFAULT,
20494 };
20495 #[cfg(feature = "arbitrary")]
20496 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20497 use arbitrary::{Arbitrary, Unstructured};
20498 let mut buf = [0u8; 1024];
20499 rng.fill_bytes(&mut buf);
20500 let mut unstructured = Unstructured::new(&buf);
20501 Self::arbitrary(&mut unstructured).unwrap_or_default()
20502 }
20503}
20504impl Default for MISSION_REQUEST_INT_DATA {
20505 fn default() -> Self {
20506 Self::DEFAULT.clone()
20507 }
20508}
20509impl MessageData for MISSION_REQUEST_INT_DATA {
20510 type Message = MavMessage;
20511 const ID: u32 = 51u32;
20512 const NAME: &'static str = "MISSION_REQUEST_INT";
20513 const EXTRA_CRC: u8 = 196u8;
20514 const ENCODED_LEN: usize = 5usize;
20515 fn deser(
20516 _version: MavlinkVersion,
20517 __input: &[u8],
20518 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20519 let avail_len = __input.len();
20520 let mut payload_buf = [0; Self::ENCODED_LEN];
20521 let mut buf = if avail_len < Self::ENCODED_LEN {
20522 payload_buf[0..avail_len].copy_from_slice(__input);
20523 Bytes::new(&payload_buf)
20524 } else {
20525 Bytes::new(__input)
20526 };
20527 let mut __struct = Self::default();
20528 __struct.seq = buf.get_u16_le();
20529 __struct.target_system = buf.get_u8();
20530 __struct.target_component = buf.get_u8();
20531 let tmp = buf.get_u8();
20532 __struct.mission_type =
20533 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20534 enum_type: "MavMissionType",
20535 value: tmp as u32,
20536 })?;
20537 Ok(__struct)
20538 }
20539 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20540 let mut __tmp = BytesMut::new(bytes);
20541 #[allow(clippy::absurd_extreme_comparisons)]
20542 #[allow(unused_comparisons)]
20543 if __tmp.remaining() < Self::ENCODED_LEN {
20544 panic!(
20545 "buffer is too small (need {} bytes, but got {})",
20546 Self::ENCODED_LEN,
20547 __tmp.remaining(),
20548 )
20549 }
20550 __tmp.put_u16_le(self.seq);
20551 __tmp.put_u8(self.target_system);
20552 __tmp.put_u8(self.target_component);
20553 if matches!(version, MavlinkVersion::V2) {
20554 __tmp.put_u8(self.mission_type as u8);
20555 let len = __tmp.len();
20556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20557 } else {
20558 __tmp.len()
20559 }
20560 }
20561}
20562#[doc = "Request the overall list of mission items from the system/component."]
20563#[doc = ""]
20564#[doc = "ID: 43"]
20565#[derive(Debug, Clone, PartialEq)]
20566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20568#[cfg_attr(feature = "ts", derive(TS))]
20569#[cfg_attr(feature = "ts", ts(export))]
20570pub struct MISSION_REQUEST_LIST_DATA {
20571 #[doc = "System ID"]
20572 pub target_system: u8,
20573 #[doc = "Component ID"]
20574 pub target_component: u8,
20575 #[doc = "Mission type."]
20576 #[cfg_attr(feature = "serde", serde(default))]
20577 pub mission_type: MavMissionType,
20578}
20579impl MISSION_REQUEST_LIST_DATA {
20580 pub const ENCODED_LEN: usize = 3usize;
20581 pub const DEFAULT: Self = Self {
20582 target_system: 0_u8,
20583 target_component: 0_u8,
20584 mission_type: MavMissionType::DEFAULT,
20585 };
20586 #[cfg(feature = "arbitrary")]
20587 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20588 use arbitrary::{Arbitrary, Unstructured};
20589 let mut buf = [0u8; 1024];
20590 rng.fill_bytes(&mut buf);
20591 let mut unstructured = Unstructured::new(&buf);
20592 Self::arbitrary(&mut unstructured).unwrap_or_default()
20593 }
20594}
20595impl Default for MISSION_REQUEST_LIST_DATA {
20596 fn default() -> Self {
20597 Self::DEFAULT.clone()
20598 }
20599}
20600impl MessageData for MISSION_REQUEST_LIST_DATA {
20601 type Message = MavMessage;
20602 const ID: u32 = 43u32;
20603 const NAME: &'static str = "MISSION_REQUEST_LIST";
20604 const EXTRA_CRC: u8 = 132u8;
20605 const ENCODED_LEN: usize = 3usize;
20606 fn deser(
20607 _version: MavlinkVersion,
20608 __input: &[u8],
20609 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20610 let avail_len = __input.len();
20611 let mut payload_buf = [0; Self::ENCODED_LEN];
20612 let mut buf = if avail_len < Self::ENCODED_LEN {
20613 payload_buf[0..avail_len].copy_from_slice(__input);
20614 Bytes::new(&payload_buf)
20615 } else {
20616 Bytes::new(__input)
20617 };
20618 let mut __struct = Self::default();
20619 __struct.target_system = buf.get_u8();
20620 __struct.target_component = buf.get_u8();
20621 let tmp = buf.get_u8();
20622 __struct.mission_type =
20623 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20624 enum_type: "MavMissionType",
20625 value: tmp as u32,
20626 })?;
20627 Ok(__struct)
20628 }
20629 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20630 let mut __tmp = BytesMut::new(bytes);
20631 #[allow(clippy::absurd_extreme_comparisons)]
20632 #[allow(unused_comparisons)]
20633 if __tmp.remaining() < Self::ENCODED_LEN {
20634 panic!(
20635 "buffer is too small (need {} bytes, but got {})",
20636 Self::ENCODED_LEN,
20637 __tmp.remaining(),
20638 )
20639 }
20640 __tmp.put_u8(self.target_system);
20641 __tmp.put_u8(self.target_component);
20642 if matches!(version, MavlinkVersion::V2) {
20643 __tmp.put_u8(self.mission_type as u8);
20644 let len = __tmp.len();
20645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20646 } else {
20647 __tmp.len()
20648 }
20649 }
20650}
20651#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20652#[doc = ""]
20653#[doc = "ID: 37"]
20654#[derive(Debug, Clone, PartialEq)]
20655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20656#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20657#[cfg_attr(feature = "ts", derive(TS))]
20658#[cfg_attr(feature = "ts", ts(export))]
20659pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20660 #[doc = "Start index"]
20661 pub start_index: i16,
20662 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20663 pub end_index: i16,
20664 #[doc = "System ID"]
20665 pub target_system: u8,
20666 #[doc = "Component ID"]
20667 pub target_component: u8,
20668 #[doc = "Mission type."]
20669 #[cfg_attr(feature = "serde", serde(default))]
20670 pub mission_type: MavMissionType,
20671}
20672impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20673 pub const ENCODED_LEN: usize = 7usize;
20674 pub const DEFAULT: Self = Self {
20675 start_index: 0_i16,
20676 end_index: 0_i16,
20677 target_system: 0_u8,
20678 target_component: 0_u8,
20679 mission_type: MavMissionType::DEFAULT,
20680 };
20681 #[cfg(feature = "arbitrary")]
20682 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20683 use arbitrary::{Arbitrary, Unstructured};
20684 let mut buf = [0u8; 1024];
20685 rng.fill_bytes(&mut buf);
20686 let mut unstructured = Unstructured::new(&buf);
20687 Self::arbitrary(&mut unstructured).unwrap_or_default()
20688 }
20689}
20690impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20691 fn default() -> Self {
20692 Self::DEFAULT.clone()
20693 }
20694}
20695impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20696 type Message = MavMessage;
20697 const ID: u32 = 37u32;
20698 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20699 const EXTRA_CRC: u8 = 212u8;
20700 const ENCODED_LEN: usize = 7usize;
20701 fn deser(
20702 _version: MavlinkVersion,
20703 __input: &[u8],
20704 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20705 let avail_len = __input.len();
20706 let mut payload_buf = [0; Self::ENCODED_LEN];
20707 let mut buf = if avail_len < Self::ENCODED_LEN {
20708 payload_buf[0..avail_len].copy_from_slice(__input);
20709 Bytes::new(&payload_buf)
20710 } else {
20711 Bytes::new(__input)
20712 };
20713 let mut __struct = Self::default();
20714 __struct.start_index = buf.get_i16_le();
20715 __struct.end_index = buf.get_i16_le();
20716 __struct.target_system = buf.get_u8();
20717 __struct.target_component = buf.get_u8();
20718 let tmp = buf.get_u8();
20719 __struct.mission_type =
20720 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20721 enum_type: "MavMissionType",
20722 value: tmp as u32,
20723 })?;
20724 Ok(__struct)
20725 }
20726 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20727 let mut __tmp = BytesMut::new(bytes);
20728 #[allow(clippy::absurd_extreme_comparisons)]
20729 #[allow(unused_comparisons)]
20730 if __tmp.remaining() < Self::ENCODED_LEN {
20731 panic!(
20732 "buffer is too small (need {} bytes, but got {})",
20733 Self::ENCODED_LEN,
20734 __tmp.remaining(),
20735 )
20736 }
20737 __tmp.put_i16_le(self.start_index);
20738 __tmp.put_i16_le(self.end_index);
20739 __tmp.put_u8(self.target_system);
20740 __tmp.put_u8(self.target_component);
20741 if matches!(version, MavlinkVersion::V2) {
20742 __tmp.put_u8(self.mission_type as u8);
20743 let len = __tmp.len();
20744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20745 } else {
20746 __tmp.len()
20747 }
20748 }
20749}
20750#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20751#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20752#[doc = ""]
20753#[doc = "ID: 41"]
20754#[derive(Debug, Clone, PartialEq)]
20755#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20756#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20757#[cfg_attr(feature = "ts", derive(TS))]
20758#[cfg_attr(feature = "ts", ts(export))]
20759pub struct MISSION_SET_CURRENT_DATA {
20760 #[doc = "Sequence"]
20761 pub seq: u16,
20762 #[doc = "System ID"]
20763 pub target_system: u8,
20764 #[doc = "Component ID"]
20765 pub target_component: u8,
20766}
20767impl MISSION_SET_CURRENT_DATA {
20768 pub const ENCODED_LEN: usize = 4usize;
20769 pub const DEFAULT: Self = Self {
20770 seq: 0_u16,
20771 target_system: 0_u8,
20772 target_component: 0_u8,
20773 };
20774 #[cfg(feature = "arbitrary")]
20775 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20776 use arbitrary::{Arbitrary, Unstructured};
20777 let mut buf = [0u8; 1024];
20778 rng.fill_bytes(&mut buf);
20779 let mut unstructured = Unstructured::new(&buf);
20780 Self::arbitrary(&mut unstructured).unwrap_or_default()
20781 }
20782}
20783impl Default for MISSION_SET_CURRENT_DATA {
20784 fn default() -> Self {
20785 Self::DEFAULT.clone()
20786 }
20787}
20788impl MessageData for MISSION_SET_CURRENT_DATA {
20789 type Message = MavMessage;
20790 const ID: u32 = 41u32;
20791 const NAME: &'static str = "MISSION_SET_CURRENT";
20792 const EXTRA_CRC: u8 = 28u8;
20793 const ENCODED_LEN: usize = 4usize;
20794 fn deser(
20795 _version: MavlinkVersion,
20796 __input: &[u8],
20797 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20798 let avail_len = __input.len();
20799 let mut payload_buf = [0; Self::ENCODED_LEN];
20800 let mut buf = if avail_len < Self::ENCODED_LEN {
20801 payload_buf[0..avail_len].copy_from_slice(__input);
20802 Bytes::new(&payload_buf)
20803 } else {
20804 Bytes::new(__input)
20805 };
20806 let mut __struct = Self::default();
20807 __struct.seq = buf.get_u16_le();
20808 __struct.target_system = buf.get_u8();
20809 __struct.target_component = buf.get_u8();
20810 Ok(__struct)
20811 }
20812 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20813 let mut __tmp = BytesMut::new(bytes);
20814 #[allow(clippy::absurd_extreme_comparisons)]
20815 #[allow(unused_comparisons)]
20816 if __tmp.remaining() < Self::ENCODED_LEN {
20817 panic!(
20818 "buffer is too small (need {} bytes, but got {})",
20819 Self::ENCODED_LEN,
20820 __tmp.remaining(),
20821 )
20822 }
20823 __tmp.put_u16_le(self.seq);
20824 __tmp.put_u8(self.target_system);
20825 __tmp.put_u8(self.target_component);
20826 if matches!(version, MavlinkVersion::V2) {
20827 let len = __tmp.len();
20828 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20829 } else {
20830 __tmp.len()
20831 }
20832 }
20833}
20834#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20835#[doc = ""]
20836#[doc = "ID: 38"]
20837#[derive(Debug, Clone, PartialEq)]
20838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20839#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20840#[cfg_attr(feature = "ts", derive(TS))]
20841#[cfg_attr(feature = "ts", ts(export))]
20842pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20843 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20844 pub start_index: i16,
20845 #[doc = "End index, equal or greater than start index."]
20846 pub end_index: i16,
20847 #[doc = "System ID"]
20848 pub target_system: u8,
20849 #[doc = "Component ID"]
20850 pub target_component: u8,
20851 #[doc = "Mission type."]
20852 #[cfg_attr(feature = "serde", serde(default))]
20853 pub mission_type: MavMissionType,
20854}
20855impl MISSION_WRITE_PARTIAL_LIST_DATA {
20856 pub const ENCODED_LEN: usize = 7usize;
20857 pub const DEFAULT: Self = Self {
20858 start_index: 0_i16,
20859 end_index: 0_i16,
20860 target_system: 0_u8,
20861 target_component: 0_u8,
20862 mission_type: MavMissionType::DEFAULT,
20863 };
20864 #[cfg(feature = "arbitrary")]
20865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20866 use arbitrary::{Arbitrary, Unstructured};
20867 let mut buf = [0u8; 1024];
20868 rng.fill_bytes(&mut buf);
20869 let mut unstructured = Unstructured::new(&buf);
20870 Self::arbitrary(&mut unstructured).unwrap_or_default()
20871 }
20872}
20873impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20874 fn default() -> Self {
20875 Self::DEFAULT.clone()
20876 }
20877}
20878impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20879 type Message = MavMessage;
20880 const ID: u32 = 38u32;
20881 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20882 const EXTRA_CRC: u8 = 9u8;
20883 const ENCODED_LEN: usize = 7usize;
20884 fn deser(
20885 _version: MavlinkVersion,
20886 __input: &[u8],
20887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20888 let avail_len = __input.len();
20889 let mut payload_buf = [0; Self::ENCODED_LEN];
20890 let mut buf = if avail_len < Self::ENCODED_LEN {
20891 payload_buf[0..avail_len].copy_from_slice(__input);
20892 Bytes::new(&payload_buf)
20893 } else {
20894 Bytes::new(__input)
20895 };
20896 let mut __struct = Self::default();
20897 __struct.start_index = buf.get_i16_le();
20898 __struct.end_index = buf.get_i16_le();
20899 __struct.target_system = buf.get_u8();
20900 __struct.target_component = buf.get_u8();
20901 let tmp = buf.get_u8();
20902 __struct.mission_type =
20903 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20904 enum_type: "MavMissionType",
20905 value: tmp as u32,
20906 })?;
20907 Ok(__struct)
20908 }
20909 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20910 let mut __tmp = BytesMut::new(bytes);
20911 #[allow(clippy::absurd_extreme_comparisons)]
20912 #[allow(unused_comparisons)]
20913 if __tmp.remaining() < Self::ENCODED_LEN {
20914 panic!(
20915 "buffer is too small (need {} bytes, but got {})",
20916 Self::ENCODED_LEN,
20917 __tmp.remaining(),
20918 )
20919 }
20920 __tmp.put_i16_le(self.start_index);
20921 __tmp.put_i16_le(self.end_index);
20922 __tmp.put_u8(self.target_system);
20923 __tmp.put_u8(self.target_component);
20924 if matches!(version, MavlinkVersion::V2) {
20925 __tmp.put_u8(self.mission_type as u8);
20926 let len = __tmp.len();
20927 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20928 } else {
20929 __tmp.len()
20930 }
20931 }
20932}
20933#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20934#[doc = "Orientation of a mount."]
20935#[doc = ""]
20936#[doc = "ID: 265"]
20937#[derive(Debug, Clone, PartialEq)]
20938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20940#[cfg_attr(feature = "ts", derive(TS))]
20941#[cfg_attr(feature = "ts", ts(export))]
20942pub struct MOUNT_ORIENTATION_DATA {
20943 #[doc = "Timestamp (time since system boot)."]
20944 pub time_boot_ms: u32,
20945 #[doc = "Roll in global frame (set to NaN for invalid)."]
20946 pub roll: f32,
20947 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20948 pub pitch: f32,
20949 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20950 pub yaw: f32,
20951 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20952 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20953 pub yaw_absolute: f32,
20954}
20955impl MOUNT_ORIENTATION_DATA {
20956 pub const ENCODED_LEN: usize = 20usize;
20957 pub const DEFAULT: Self = Self {
20958 time_boot_ms: 0_u32,
20959 roll: 0.0_f32,
20960 pitch: 0.0_f32,
20961 yaw: 0.0_f32,
20962 yaw_absolute: 0.0_f32,
20963 };
20964 #[cfg(feature = "arbitrary")]
20965 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20966 use arbitrary::{Arbitrary, Unstructured};
20967 let mut buf = [0u8; 1024];
20968 rng.fill_bytes(&mut buf);
20969 let mut unstructured = Unstructured::new(&buf);
20970 Self::arbitrary(&mut unstructured).unwrap_or_default()
20971 }
20972}
20973impl Default for MOUNT_ORIENTATION_DATA {
20974 fn default() -> Self {
20975 Self::DEFAULT.clone()
20976 }
20977}
20978impl MessageData for MOUNT_ORIENTATION_DATA {
20979 type Message = MavMessage;
20980 const ID: u32 = 265u32;
20981 const NAME: &'static str = "MOUNT_ORIENTATION";
20982 const EXTRA_CRC: u8 = 26u8;
20983 const ENCODED_LEN: usize = 20usize;
20984 fn deser(
20985 _version: MavlinkVersion,
20986 __input: &[u8],
20987 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20988 let avail_len = __input.len();
20989 let mut payload_buf = [0; Self::ENCODED_LEN];
20990 let mut buf = if avail_len < Self::ENCODED_LEN {
20991 payload_buf[0..avail_len].copy_from_slice(__input);
20992 Bytes::new(&payload_buf)
20993 } else {
20994 Bytes::new(__input)
20995 };
20996 let mut __struct = Self::default();
20997 __struct.time_boot_ms = buf.get_u32_le();
20998 __struct.roll = buf.get_f32_le();
20999 __struct.pitch = buf.get_f32_le();
21000 __struct.yaw = buf.get_f32_le();
21001 __struct.yaw_absolute = buf.get_f32_le();
21002 Ok(__struct)
21003 }
21004 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21005 let mut __tmp = BytesMut::new(bytes);
21006 #[allow(clippy::absurd_extreme_comparisons)]
21007 #[allow(unused_comparisons)]
21008 if __tmp.remaining() < Self::ENCODED_LEN {
21009 panic!(
21010 "buffer is too small (need {} bytes, but got {})",
21011 Self::ENCODED_LEN,
21012 __tmp.remaining(),
21013 )
21014 }
21015 __tmp.put_u32_le(self.time_boot_ms);
21016 __tmp.put_f32_le(self.roll);
21017 __tmp.put_f32_le(self.pitch);
21018 __tmp.put_f32_le(self.yaw);
21019 if matches!(version, MavlinkVersion::V2) {
21020 __tmp.put_f32_le(self.yaw_absolute);
21021 let len = __tmp.len();
21022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21023 } else {
21024 __tmp.len()
21025 }
21026 }
21027}
21028#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21029#[doc = ""]
21030#[doc = "ID: 251"]
21031#[derive(Debug, Clone, PartialEq)]
21032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21034#[cfg_attr(feature = "ts", derive(TS))]
21035#[cfg_attr(feature = "ts", ts(export))]
21036pub struct NAMED_VALUE_FLOAT_DATA {
21037 #[doc = "Timestamp (time since system boot)."]
21038 pub time_boot_ms: u32,
21039 #[doc = "Floating point value"]
21040 pub value: f32,
21041 #[doc = "Name of the debug variable"]
21042 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21043 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21044 pub name: [u8; 10],
21045}
21046impl NAMED_VALUE_FLOAT_DATA {
21047 pub const ENCODED_LEN: usize = 18usize;
21048 pub const DEFAULT: Self = Self {
21049 time_boot_ms: 0_u32,
21050 value: 0.0_f32,
21051 name: [0_u8; 10usize],
21052 };
21053 #[cfg(feature = "arbitrary")]
21054 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21055 use arbitrary::{Arbitrary, Unstructured};
21056 let mut buf = [0u8; 1024];
21057 rng.fill_bytes(&mut buf);
21058 let mut unstructured = Unstructured::new(&buf);
21059 Self::arbitrary(&mut unstructured).unwrap_or_default()
21060 }
21061}
21062impl Default for NAMED_VALUE_FLOAT_DATA {
21063 fn default() -> Self {
21064 Self::DEFAULT.clone()
21065 }
21066}
21067impl MessageData for NAMED_VALUE_FLOAT_DATA {
21068 type Message = MavMessage;
21069 const ID: u32 = 251u32;
21070 const NAME: &'static str = "NAMED_VALUE_FLOAT";
21071 const EXTRA_CRC: u8 = 170u8;
21072 const ENCODED_LEN: usize = 18usize;
21073 fn deser(
21074 _version: MavlinkVersion,
21075 __input: &[u8],
21076 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21077 let avail_len = __input.len();
21078 let mut payload_buf = [0; Self::ENCODED_LEN];
21079 let mut buf = if avail_len < Self::ENCODED_LEN {
21080 payload_buf[0..avail_len].copy_from_slice(__input);
21081 Bytes::new(&payload_buf)
21082 } else {
21083 Bytes::new(__input)
21084 };
21085 let mut __struct = Self::default();
21086 __struct.time_boot_ms = buf.get_u32_le();
21087 __struct.value = buf.get_f32_le();
21088 for v in &mut __struct.name {
21089 let val = buf.get_u8();
21090 *v = val;
21091 }
21092 Ok(__struct)
21093 }
21094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21095 let mut __tmp = BytesMut::new(bytes);
21096 #[allow(clippy::absurd_extreme_comparisons)]
21097 #[allow(unused_comparisons)]
21098 if __tmp.remaining() < Self::ENCODED_LEN {
21099 panic!(
21100 "buffer is too small (need {} bytes, but got {})",
21101 Self::ENCODED_LEN,
21102 __tmp.remaining(),
21103 )
21104 }
21105 __tmp.put_u32_le(self.time_boot_ms);
21106 __tmp.put_f32_le(self.value);
21107 for val in &self.name {
21108 __tmp.put_u8(*val);
21109 }
21110 if matches!(version, MavlinkVersion::V2) {
21111 let len = __tmp.len();
21112 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21113 } else {
21114 __tmp.len()
21115 }
21116 }
21117}
21118#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21119#[doc = ""]
21120#[doc = "ID: 252"]
21121#[derive(Debug, Clone, PartialEq)]
21122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21124#[cfg_attr(feature = "ts", derive(TS))]
21125#[cfg_attr(feature = "ts", ts(export))]
21126pub struct NAMED_VALUE_INT_DATA {
21127 #[doc = "Timestamp (time since system boot)."]
21128 pub time_boot_ms: u32,
21129 #[doc = "Signed integer value"]
21130 pub value: i32,
21131 #[doc = "Name of the debug variable"]
21132 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21133 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21134 pub name: [u8; 10],
21135}
21136impl NAMED_VALUE_INT_DATA {
21137 pub const ENCODED_LEN: usize = 18usize;
21138 pub const DEFAULT: Self = Self {
21139 time_boot_ms: 0_u32,
21140 value: 0_i32,
21141 name: [0_u8; 10usize],
21142 };
21143 #[cfg(feature = "arbitrary")]
21144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21145 use arbitrary::{Arbitrary, Unstructured};
21146 let mut buf = [0u8; 1024];
21147 rng.fill_bytes(&mut buf);
21148 let mut unstructured = Unstructured::new(&buf);
21149 Self::arbitrary(&mut unstructured).unwrap_or_default()
21150 }
21151}
21152impl Default for NAMED_VALUE_INT_DATA {
21153 fn default() -> Self {
21154 Self::DEFAULT.clone()
21155 }
21156}
21157impl MessageData for NAMED_VALUE_INT_DATA {
21158 type Message = MavMessage;
21159 const ID: u32 = 252u32;
21160 const NAME: &'static str = "NAMED_VALUE_INT";
21161 const EXTRA_CRC: u8 = 44u8;
21162 const ENCODED_LEN: usize = 18usize;
21163 fn deser(
21164 _version: MavlinkVersion,
21165 __input: &[u8],
21166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21167 let avail_len = __input.len();
21168 let mut payload_buf = [0; Self::ENCODED_LEN];
21169 let mut buf = if avail_len < Self::ENCODED_LEN {
21170 payload_buf[0..avail_len].copy_from_slice(__input);
21171 Bytes::new(&payload_buf)
21172 } else {
21173 Bytes::new(__input)
21174 };
21175 let mut __struct = Self::default();
21176 __struct.time_boot_ms = buf.get_u32_le();
21177 __struct.value = buf.get_i32_le();
21178 for v in &mut __struct.name {
21179 let val = buf.get_u8();
21180 *v = val;
21181 }
21182 Ok(__struct)
21183 }
21184 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21185 let mut __tmp = BytesMut::new(bytes);
21186 #[allow(clippy::absurd_extreme_comparisons)]
21187 #[allow(unused_comparisons)]
21188 if __tmp.remaining() < Self::ENCODED_LEN {
21189 panic!(
21190 "buffer is too small (need {} bytes, but got {})",
21191 Self::ENCODED_LEN,
21192 __tmp.remaining(),
21193 )
21194 }
21195 __tmp.put_u32_le(self.time_boot_ms);
21196 __tmp.put_i32_le(self.value);
21197 for val in &self.name {
21198 __tmp.put_u8(*val);
21199 }
21200 if matches!(version, MavlinkVersion::V2) {
21201 let len = __tmp.len();
21202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21203 } else {
21204 __tmp.len()
21205 }
21206 }
21207}
21208#[doc = "The state of the navigation and position controller."]
21209#[doc = ""]
21210#[doc = "ID: 62"]
21211#[derive(Debug, Clone, PartialEq)]
21212#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21214#[cfg_attr(feature = "ts", derive(TS))]
21215#[cfg_attr(feature = "ts", ts(export))]
21216pub struct NAV_CONTROLLER_OUTPUT_DATA {
21217 #[doc = "Current desired roll"]
21218 pub nav_roll: f32,
21219 #[doc = "Current desired pitch"]
21220 pub nav_pitch: f32,
21221 #[doc = "Current altitude error"]
21222 pub alt_error: f32,
21223 #[doc = "Current airspeed error"]
21224 pub aspd_error: f32,
21225 #[doc = "Current crosstrack error on x-y plane"]
21226 pub xtrack_error: f32,
21227 #[doc = "Current desired heading"]
21228 pub nav_bearing: i16,
21229 #[doc = "Bearing to current waypoint/target"]
21230 pub target_bearing: i16,
21231 #[doc = "Distance to active waypoint"]
21232 pub wp_dist: u16,
21233}
21234impl NAV_CONTROLLER_OUTPUT_DATA {
21235 pub const ENCODED_LEN: usize = 26usize;
21236 pub const DEFAULT: Self = Self {
21237 nav_roll: 0.0_f32,
21238 nav_pitch: 0.0_f32,
21239 alt_error: 0.0_f32,
21240 aspd_error: 0.0_f32,
21241 xtrack_error: 0.0_f32,
21242 nav_bearing: 0_i16,
21243 target_bearing: 0_i16,
21244 wp_dist: 0_u16,
21245 };
21246 #[cfg(feature = "arbitrary")]
21247 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21248 use arbitrary::{Arbitrary, Unstructured};
21249 let mut buf = [0u8; 1024];
21250 rng.fill_bytes(&mut buf);
21251 let mut unstructured = Unstructured::new(&buf);
21252 Self::arbitrary(&mut unstructured).unwrap_or_default()
21253 }
21254}
21255impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21256 fn default() -> Self {
21257 Self::DEFAULT.clone()
21258 }
21259}
21260impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21261 type Message = MavMessage;
21262 const ID: u32 = 62u32;
21263 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21264 const EXTRA_CRC: u8 = 183u8;
21265 const ENCODED_LEN: usize = 26usize;
21266 fn deser(
21267 _version: MavlinkVersion,
21268 __input: &[u8],
21269 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21270 let avail_len = __input.len();
21271 let mut payload_buf = [0; Self::ENCODED_LEN];
21272 let mut buf = if avail_len < Self::ENCODED_LEN {
21273 payload_buf[0..avail_len].copy_from_slice(__input);
21274 Bytes::new(&payload_buf)
21275 } else {
21276 Bytes::new(__input)
21277 };
21278 let mut __struct = Self::default();
21279 __struct.nav_roll = buf.get_f32_le();
21280 __struct.nav_pitch = buf.get_f32_le();
21281 __struct.alt_error = buf.get_f32_le();
21282 __struct.aspd_error = buf.get_f32_le();
21283 __struct.xtrack_error = buf.get_f32_le();
21284 __struct.nav_bearing = buf.get_i16_le();
21285 __struct.target_bearing = buf.get_i16_le();
21286 __struct.wp_dist = buf.get_u16_le();
21287 Ok(__struct)
21288 }
21289 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21290 let mut __tmp = BytesMut::new(bytes);
21291 #[allow(clippy::absurd_extreme_comparisons)]
21292 #[allow(unused_comparisons)]
21293 if __tmp.remaining() < Self::ENCODED_LEN {
21294 panic!(
21295 "buffer is too small (need {} bytes, but got {})",
21296 Self::ENCODED_LEN,
21297 __tmp.remaining(),
21298 )
21299 }
21300 __tmp.put_f32_le(self.nav_roll);
21301 __tmp.put_f32_le(self.nav_pitch);
21302 __tmp.put_f32_le(self.alt_error);
21303 __tmp.put_f32_le(self.aspd_error);
21304 __tmp.put_f32_le(self.xtrack_error);
21305 __tmp.put_i16_le(self.nav_bearing);
21306 __tmp.put_i16_le(self.target_bearing);
21307 __tmp.put_u16_le(self.wp_dist);
21308 if matches!(version, MavlinkVersion::V2) {
21309 let len = __tmp.len();
21310 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21311 } else {
21312 __tmp.len()
21313 }
21314 }
21315}
21316#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21317#[doc = ""]
21318#[doc = "ID: 330"]
21319#[derive(Debug, Clone, PartialEq)]
21320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21321#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21322#[cfg_attr(feature = "ts", derive(TS))]
21323#[cfg_attr(feature = "ts", ts(export))]
21324pub struct OBSTACLE_DISTANCE_DATA {
21325 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21326 pub time_usec: u64,
21327 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21328 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21329 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21330 pub distances: [u16; 72],
21331 #[doc = "Minimum distance the sensor can measure."]
21332 pub min_distance: u16,
21333 #[doc = "Maximum distance the sensor can measure."]
21334 pub max_distance: u16,
21335 #[doc = "Class id of the distance sensor type."]
21336 pub sensor_type: MavDistanceSensor,
21337 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21338 pub increment: u8,
21339 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21340 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21341 pub increment_f: f32,
21342 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21343 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21344 pub angle_offset: f32,
21345 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21346 #[cfg_attr(feature = "serde", serde(default))]
21347 pub frame: MavFrame,
21348}
21349impl OBSTACLE_DISTANCE_DATA {
21350 pub const ENCODED_LEN: usize = 167usize;
21351 pub const DEFAULT: Self = Self {
21352 time_usec: 0_u64,
21353 distances: [0_u16; 72usize],
21354 min_distance: 0_u16,
21355 max_distance: 0_u16,
21356 sensor_type: MavDistanceSensor::DEFAULT,
21357 increment: 0_u8,
21358 increment_f: 0.0_f32,
21359 angle_offset: 0.0_f32,
21360 frame: MavFrame::DEFAULT,
21361 };
21362 #[cfg(feature = "arbitrary")]
21363 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21364 use arbitrary::{Arbitrary, Unstructured};
21365 let mut buf = [0u8; 1024];
21366 rng.fill_bytes(&mut buf);
21367 let mut unstructured = Unstructured::new(&buf);
21368 Self::arbitrary(&mut unstructured).unwrap_or_default()
21369 }
21370}
21371impl Default for OBSTACLE_DISTANCE_DATA {
21372 fn default() -> Self {
21373 Self::DEFAULT.clone()
21374 }
21375}
21376impl MessageData for OBSTACLE_DISTANCE_DATA {
21377 type Message = MavMessage;
21378 const ID: u32 = 330u32;
21379 const NAME: &'static str = "OBSTACLE_DISTANCE";
21380 const EXTRA_CRC: u8 = 23u8;
21381 const ENCODED_LEN: usize = 167usize;
21382 fn deser(
21383 _version: MavlinkVersion,
21384 __input: &[u8],
21385 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21386 let avail_len = __input.len();
21387 let mut payload_buf = [0; Self::ENCODED_LEN];
21388 let mut buf = if avail_len < Self::ENCODED_LEN {
21389 payload_buf[0..avail_len].copy_from_slice(__input);
21390 Bytes::new(&payload_buf)
21391 } else {
21392 Bytes::new(__input)
21393 };
21394 let mut __struct = Self::default();
21395 __struct.time_usec = buf.get_u64_le();
21396 for v in &mut __struct.distances {
21397 let val = buf.get_u16_le();
21398 *v = val;
21399 }
21400 __struct.min_distance = buf.get_u16_le();
21401 __struct.max_distance = buf.get_u16_le();
21402 let tmp = buf.get_u8();
21403 __struct.sensor_type =
21404 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21405 enum_type: "MavDistanceSensor",
21406 value: tmp as u32,
21407 })?;
21408 __struct.increment = buf.get_u8();
21409 __struct.increment_f = buf.get_f32_le();
21410 __struct.angle_offset = buf.get_f32_le();
21411 let tmp = buf.get_u8();
21412 __struct.frame =
21413 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21414 enum_type: "MavFrame",
21415 value: tmp as u32,
21416 })?;
21417 Ok(__struct)
21418 }
21419 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21420 let mut __tmp = BytesMut::new(bytes);
21421 #[allow(clippy::absurd_extreme_comparisons)]
21422 #[allow(unused_comparisons)]
21423 if __tmp.remaining() < Self::ENCODED_LEN {
21424 panic!(
21425 "buffer is too small (need {} bytes, but got {})",
21426 Self::ENCODED_LEN,
21427 __tmp.remaining(),
21428 )
21429 }
21430 __tmp.put_u64_le(self.time_usec);
21431 for val in &self.distances {
21432 __tmp.put_u16_le(*val);
21433 }
21434 __tmp.put_u16_le(self.min_distance);
21435 __tmp.put_u16_le(self.max_distance);
21436 __tmp.put_u8(self.sensor_type as u8);
21437 __tmp.put_u8(self.increment);
21438 if matches!(version, MavlinkVersion::V2) {
21439 __tmp.put_f32_le(self.increment_f);
21440 __tmp.put_f32_le(self.angle_offset);
21441 __tmp.put_u8(self.frame as u8);
21442 let len = __tmp.len();
21443 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21444 } else {
21445 __tmp.len()
21446 }
21447 }
21448}
21449#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21450#[doc = ""]
21451#[doc = "ID: 331"]
21452#[derive(Debug, Clone, PartialEq)]
21453#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21454#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21455#[cfg_attr(feature = "ts", derive(TS))]
21456#[cfg_attr(feature = "ts", ts(export))]
21457pub struct ODOMETRY_DATA {
21458 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21459 pub time_usec: u64,
21460 #[doc = "X Position"]
21461 pub x: f32,
21462 #[doc = "Y Position"]
21463 pub y: f32,
21464 #[doc = "Z Position"]
21465 pub z: f32,
21466 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21467 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21468 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21469 pub q: [f32; 4],
21470 #[doc = "X linear speed"]
21471 pub vx: f32,
21472 #[doc = "Y linear speed"]
21473 pub vy: f32,
21474 #[doc = "Z linear speed"]
21475 pub vz: f32,
21476 #[doc = "Roll angular speed"]
21477 pub rollspeed: f32,
21478 #[doc = "Pitch angular speed"]
21479 pub pitchspeed: f32,
21480 #[doc = "Yaw angular speed"]
21481 pub yawspeed: f32,
21482 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21483 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21484 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21485 pub pose_covariance: [f32; 21],
21486 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21487 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21488 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21489 pub velocity_covariance: [f32; 21],
21490 #[doc = "Coordinate frame of reference for the pose data."]
21491 pub frame_id: MavFrame,
21492 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21493 pub child_frame_id: MavFrame,
21494 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21495 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21496 pub reset_counter: u8,
21497 #[doc = "Type of estimator that is providing the odometry."]
21498 #[cfg_attr(feature = "serde", serde(default))]
21499 pub estimator_type: MavEstimatorType,
21500 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21501 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21502 pub quality: i8,
21503}
21504impl ODOMETRY_DATA {
21505 pub const ENCODED_LEN: usize = 233usize;
21506 pub const DEFAULT: Self = Self {
21507 time_usec: 0_u64,
21508 x: 0.0_f32,
21509 y: 0.0_f32,
21510 z: 0.0_f32,
21511 q: [0.0_f32; 4usize],
21512 vx: 0.0_f32,
21513 vy: 0.0_f32,
21514 vz: 0.0_f32,
21515 rollspeed: 0.0_f32,
21516 pitchspeed: 0.0_f32,
21517 yawspeed: 0.0_f32,
21518 pose_covariance: [0.0_f32; 21usize],
21519 velocity_covariance: [0.0_f32; 21usize],
21520 frame_id: MavFrame::DEFAULT,
21521 child_frame_id: MavFrame::DEFAULT,
21522 reset_counter: 0_u8,
21523 estimator_type: MavEstimatorType::DEFAULT,
21524 quality: 0_i8,
21525 };
21526 #[cfg(feature = "arbitrary")]
21527 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21528 use arbitrary::{Arbitrary, Unstructured};
21529 let mut buf = [0u8; 1024];
21530 rng.fill_bytes(&mut buf);
21531 let mut unstructured = Unstructured::new(&buf);
21532 Self::arbitrary(&mut unstructured).unwrap_or_default()
21533 }
21534}
21535impl Default for ODOMETRY_DATA {
21536 fn default() -> Self {
21537 Self::DEFAULT.clone()
21538 }
21539}
21540impl MessageData for ODOMETRY_DATA {
21541 type Message = MavMessage;
21542 const ID: u32 = 331u32;
21543 const NAME: &'static str = "ODOMETRY";
21544 const EXTRA_CRC: u8 = 91u8;
21545 const ENCODED_LEN: usize = 233usize;
21546 fn deser(
21547 _version: MavlinkVersion,
21548 __input: &[u8],
21549 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21550 let avail_len = __input.len();
21551 let mut payload_buf = [0; Self::ENCODED_LEN];
21552 let mut buf = if avail_len < Self::ENCODED_LEN {
21553 payload_buf[0..avail_len].copy_from_slice(__input);
21554 Bytes::new(&payload_buf)
21555 } else {
21556 Bytes::new(__input)
21557 };
21558 let mut __struct = Self::default();
21559 __struct.time_usec = buf.get_u64_le();
21560 __struct.x = buf.get_f32_le();
21561 __struct.y = buf.get_f32_le();
21562 __struct.z = buf.get_f32_le();
21563 for v in &mut __struct.q {
21564 let val = buf.get_f32_le();
21565 *v = val;
21566 }
21567 __struct.vx = buf.get_f32_le();
21568 __struct.vy = buf.get_f32_le();
21569 __struct.vz = buf.get_f32_le();
21570 __struct.rollspeed = buf.get_f32_le();
21571 __struct.pitchspeed = buf.get_f32_le();
21572 __struct.yawspeed = buf.get_f32_le();
21573 for v in &mut __struct.pose_covariance {
21574 let val = buf.get_f32_le();
21575 *v = val;
21576 }
21577 for v in &mut __struct.velocity_covariance {
21578 let val = buf.get_f32_le();
21579 *v = val;
21580 }
21581 let tmp = buf.get_u8();
21582 __struct.frame_id =
21583 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21584 enum_type: "MavFrame",
21585 value: tmp as u32,
21586 })?;
21587 let tmp = buf.get_u8();
21588 __struct.child_frame_id =
21589 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21590 enum_type: "MavFrame",
21591 value: tmp as u32,
21592 })?;
21593 __struct.reset_counter = buf.get_u8();
21594 let tmp = buf.get_u8();
21595 __struct.estimator_type =
21596 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21597 enum_type: "MavEstimatorType",
21598 value: tmp as u32,
21599 })?;
21600 __struct.quality = buf.get_i8();
21601 Ok(__struct)
21602 }
21603 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21604 let mut __tmp = BytesMut::new(bytes);
21605 #[allow(clippy::absurd_extreme_comparisons)]
21606 #[allow(unused_comparisons)]
21607 if __tmp.remaining() < Self::ENCODED_LEN {
21608 panic!(
21609 "buffer is too small (need {} bytes, but got {})",
21610 Self::ENCODED_LEN,
21611 __tmp.remaining(),
21612 )
21613 }
21614 __tmp.put_u64_le(self.time_usec);
21615 __tmp.put_f32_le(self.x);
21616 __tmp.put_f32_le(self.y);
21617 __tmp.put_f32_le(self.z);
21618 for val in &self.q {
21619 __tmp.put_f32_le(*val);
21620 }
21621 __tmp.put_f32_le(self.vx);
21622 __tmp.put_f32_le(self.vy);
21623 __tmp.put_f32_le(self.vz);
21624 __tmp.put_f32_le(self.rollspeed);
21625 __tmp.put_f32_le(self.pitchspeed);
21626 __tmp.put_f32_le(self.yawspeed);
21627 for val in &self.pose_covariance {
21628 __tmp.put_f32_le(*val);
21629 }
21630 for val in &self.velocity_covariance {
21631 __tmp.put_f32_le(*val);
21632 }
21633 __tmp.put_u8(self.frame_id as u8);
21634 __tmp.put_u8(self.child_frame_id as u8);
21635 if matches!(version, MavlinkVersion::V2) {
21636 __tmp.put_u8(self.reset_counter);
21637 __tmp.put_u8(self.estimator_type as u8);
21638 __tmp.put_i8(self.quality);
21639 let len = __tmp.len();
21640 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21641 } else {
21642 __tmp.len()
21643 }
21644 }
21645}
21646#[doc = "Hardware status sent by an onboard computer."]
21647#[doc = ""]
21648#[doc = "ID: 390"]
21649#[derive(Debug, Clone, PartialEq)]
21650#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21652#[cfg_attr(feature = "ts", derive(TS))]
21653#[cfg_attr(feature = "ts", ts(export))]
21654pub struct ONBOARD_COMPUTER_STATUS_DATA {
21655 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21656 pub time_usec: u64,
21657 #[doc = "Time since system boot."]
21658 pub uptime: u32,
21659 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21660 pub ram_usage: u32,
21661 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21662 pub ram_total: u32,
21663 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21664 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21665 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21666 pub storage_type: [u32; 4],
21667 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21668 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21669 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21670 pub storage_usage: [u32; 4],
21671 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21672 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21673 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21674 pub storage_total: [u32; 4],
21675 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21676 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21677 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21678 pub link_type: [u32; 6],
21679 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21680 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21681 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21682 pub link_tx_rate: [u32; 6],
21683 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21684 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21685 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21686 pub link_rx_rate: [u32; 6],
21687 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21688 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21689 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21690 pub link_tx_max: [u32; 6],
21691 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21692 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21693 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21694 pub link_rx_max: [u32; 6],
21695 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21696 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21697 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21698 pub fan_speed: [i16; 4],
21699 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21700 pub mavtype: u8,
21701 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21702 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21703 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21704 pub cpu_cores: [u8; 8],
21705 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21706 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21707 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21708 pub cpu_combined: [u8; 10],
21709 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21710 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21711 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21712 pub gpu_cores: [u8; 4],
21713 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21714 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21715 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21716 pub gpu_combined: [u8; 10],
21717 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21718 pub temperature_board: i8,
21719 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21720 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21721 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21722 pub temperature_core: [i8; 8],
21723}
21724impl ONBOARD_COMPUTER_STATUS_DATA {
21725 pub const ENCODED_LEN: usize = 238usize;
21726 pub const DEFAULT: Self = Self {
21727 time_usec: 0_u64,
21728 uptime: 0_u32,
21729 ram_usage: 0_u32,
21730 ram_total: 0_u32,
21731 storage_type: [0_u32; 4usize],
21732 storage_usage: [0_u32; 4usize],
21733 storage_total: [0_u32; 4usize],
21734 link_type: [0_u32; 6usize],
21735 link_tx_rate: [0_u32; 6usize],
21736 link_rx_rate: [0_u32; 6usize],
21737 link_tx_max: [0_u32; 6usize],
21738 link_rx_max: [0_u32; 6usize],
21739 fan_speed: [0_i16; 4usize],
21740 mavtype: 0_u8,
21741 cpu_cores: [0_u8; 8usize],
21742 cpu_combined: [0_u8; 10usize],
21743 gpu_cores: [0_u8; 4usize],
21744 gpu_combined: [0_u8; 10usize],
21745 temperature_board: 0_i8,
21746 temperature_core: [0_i8; 8usize],
21747 };
21748 #[cfg(feature = "arbitrary")]
21749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21750 use arbitrary::{Arbitrary, Unstructured};
21751 let mut buf = [0u8; 1024];
21752 rng.fill_bytes(&mut buf);
21753 let mut unstructured = Unstructured::new(&buf);
21754 Self::arbitrary(&mut unstructured).unwrap_or_default()
21755 }
21756}
21757impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21758 fn default() -> Self {
21759 Self::DEFAULT.clone()
21760 }
21761}
21762impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21763 type Message = MavMessage;
21764 const ID: u32 = 390u32;
21765 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21766 const EXTRA_CRC: u8 = 156u8;
21767 const ENCODED_LEN: usize = 238usize;
21768 fn deser(
21769 _version: MavlinkVersion,
21770 __input: &[u8],
21771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21772 let avail_len = __input.len();
21773 let mut payload_buf = [0; Self::ENCODED_LEN];
21774 let mut buf = if avail_len < Self::ENCODED_LEN {
21775 payload_buf[0..avail_len].copy_from_slice(__input);
21776 Bytes::new(&payload_buf)
21777 } else {
21778 Bytes::new(__input)
21779 };
21780 let mut __struct = Self::default();
21781 __struct.time_usec = buf.get_u64_le();
21782 __struct.uptime = buf.get_u32_le();
21783 __struct.ram_usage = buf.get_u32_le();
21784 __struct.ram_total = buf.get_u32_le();
21785 for v in &mut __struct.storage_type {
21786 let val = buf.get_u32_le();
21787 *v = val;
21788 }
21789 for v in &mut __struct.storage_usage {
21790 let val = buf.get_u32_le();
21791 *v = val;
21792 }
21793 for v in &mut __struct.storage_total {
21794 let val = buf.get_u32_le();
21795 *v = val;
21796 }
21797 for v in &mut __struct.link_type {
21798 let val = buf.get_u32_le();
21799 *v = val;
21800 }
21801 for v in &mut __struct.link_tx_rate {
21802 let val = buf.get_u32_le();
21803 *v = val;
21804 }
21805 for v in &mut __struct.link_rx_rate {
21806 let val = buf.get_u32_le();
21807 *v = val;
21808 }
21809 for v in &mut __struct.link_tx_max {
21810 let val = buf.get_u32_le();
21811 *v = val;
21812 }
21813 for v in &mut __struct.link_rx_max {
21814 let val = buf.get_u32_le();
21815 *v = val;
21816 }
21817 for v in &mut __struct.fan_speed {
21818 let val = buf.get_i16_le();
21819 *v = val;
21820 }
21821 __struct.mavtype = buf.get_u8();
21822 for v in &mut __struct.cpu_cores {
21823 let val = buf.get_u8();
21824 *v = val;
21825 }
21826 for v in &mut __struct.cpu_combined {
21827 let val = buf.get_u8();
21828 *v = val;
21829 }
21830 for v in &mut __struct.gpu_cores {
21831 let val = buf.get_u8();
21832 *v = val;
21833 }
21834 for v in &mut __struct.gpu_combined {
21835 let val = buf.get_u8();
21836 *v = val;
21837 }
21838 __struct.temperature_board = buf.get_i8();
21839 for v in &mut __struct.temperature_core {
21840 let val = buf.get_i8();
21841 *v = val;
21842 }
21843 Ok(__struct)
21844 }
21845 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21846 let mut __tmp = BytesMut::new(bytes);
21847 #[allow(clippy::absurd_extreme_comparisons)]
21848 #[allow(unused_comparisons)]
21849 if __tmp.remaining() < Self::ENCODED_LEN {
21850 panic!(
21851 "buffer is too small (need {} bytes, but got {})",
21852 Self::ENCODED_LEN,
21853 __tmp.remaining(),
21854 )
21855 }
21856 __tmp.put_u64_le(self.time_usec);
21857 __tmp.put_u32_le(self.uptime);
21858 __tmp.put_u32_le(self.ram_usage);
21859 __tmp.put_u32_le(self.ram_total);
21860 for val in &self.storage_type {
21861 __tmp.put_u32_le(*val);
21862 }
21863 for val in &self.storage_usage {
21864 __tmp.put_u32_le(*val);
21865 }
21866 for val in &self.storage_total {
21867 __tmp.put_u32_le(*val);
21868 }
21869 for val in &self.link_type {
21870 __tmp.put_u32_le(*val);
21871 }
21872 for val in &self.link_tx_rate {
21873 __tmp.put_u32_le(*val);
21874 }
21875 for val in &self.link_rx_rate {
21876 __tmp.put_u32_le(*val);
21877 }
21878 for val in &self.link_tx_max {
21879 __tmp.put_u32_le(*val);
21880 }
21881 for val in &self.link_rx_max {
21882 __tmp.put_u32_le(*val);
21883 }
21884 for val in &self.fan_speed {
21885 __tmp.put_i16_le(*val);
21886 }
21887 __tmp.put_u8(self.mavtype);
21888 for val in &self.cpu_cores {
21889 __tmp.put_u8(*val);
21890 }
21891 for val in &self.cpu_combined {
21892 __tmp.put_u8(*val);
21893 }
21894 for val in &self.gpu_cores {
21895 __tmp.put_u8(*val);
21896 }
21897 for val in &self.gpu_combined {
21898 __tmp.put_u8(*val);
21899 }
21900 __tmp.put_i8(self.temperature_board);
21901 for val in &self.temperature_core {
21902 __tmp.put_i8(*val);
21903 }
21904 if matches!(version, MavlinkVersion::V2) {
21905 let len = __tmp.len();
21906 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21907 } else {
21908 __tmp.len()
21909 }
21910 }
21911}
21912#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21913#[doc = ""]
21914#[doc = "ID: 12918"]
21915#[derive(Debug, Clone, PartialEq)]
21916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21918#[cfg_attr(feature = "ts", derive(TS))]
21919#[cfg_attr(feature = "ts", ts(export))]
21920pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21921 #[doc = "Status level indicating if arming is allowed."]
21922 pub status: MavOdidArmStatus,
21923 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21924 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21925 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21926 pub error: [u8; 50],
21927}
21928impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21929 pub const ENCODED_LEN: usize = 51usize;
21930 pub const DEFAULT: Self = Self {
21931 status: MavOdidArmStatus::DEFAULT,
21932 error: [0_u8; 50usize],
21933 };
21934 #[cfg(feature = "arbitrary")]
21935 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21936 use arbitrary::{Arbitrary, Unstructured};
21937 let mut buf = [0u8; 1024];
21938 rng.fill_bytes(&mut buf);
21939 let mut unstructured = Unstructured::new(&buf);
21940 Self::arbitrary(&mut unstructured).unwrap_or_default()
21941 }
21942}
21943impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21944 fn default() -> Self {
21945 Self::DEFAULT.clone()
21946 }
21947}
21948impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21949 type Message = MavMessage;
21950 const ID: u32 = 12918u32;
21951 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21952 const EXTRA_CRC: u8 = 139u8;
21953 const ENCODED_LEN: usize = 51usize;
21954 fn deser(
21955 _version: MavlinkVersion,
21956 __input: &[u8],
21957 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21958 let avail_len = __input.len();
21959 let mut payload_buf = [0; Self::ENCODED_LEN];
21960 let mut buf = if avail_len < Self::ENCODED_LEN {
21961 payload_buf[0..avail_len].copy_from_slice(__input);
21962 Bytes::new(&payload_buf)
21963 } else {
21964 Bytes::new(__input)
21965 };
21966 let mut __struct = Self::default();
21967 let tmp = buf.get_u8();
21968 __struct.status =
21969 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21970 enum_type: "MavOdidArmStatus",
21971 value: tmp as u32,
21972 })?;
21973 for v in &mut __struct.error {
21974 let val = buf.get_u8();
21975 *v = val;
21976 }
21977 Ok(__struct)
21978 }
21979 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21980 let mut __tmp = BytesMut::new(bytes);
21981 #[allow(clippy::absurd_extreme_comparisons)]
21982 #[allow(unused_comparisons)]
21983 if __tmp.remaining() < Self::ENCODED_LEN {
21984 panic!(
21985 "buffer is too small (need {} bytes, but got {})",
21986 Self::ENCODED_LEN,
21987 __tmp.remaining(),
21988 )
21989 }
21990 __tmp.put_u8(self.status as u8);
21991 for val in &self.error {
21992 __tmp.put_u8(*val);
21993 }
21994 if matches!(version, MavlinkVersion::V2) {
21995 let len = __tmp.len();
21996 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21997 } else {
21998 __tmp.len()
21999 }
22000 }
22001}
22002#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
22003#[doc = ""]
22004#[doc = "ID: 12902"]
22005#[derive(Debug, Clone, PartialEq)]
22006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22007#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22008#[cfg_attr(feature = "ts", derive(TS))]
22009#[cfg_attr(feature = "ts", ts(export))]
22010pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
22011 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22012 pub timestamp: u32,
22013 #[doc = "System ID (0 for broadcast)."]
22014 pub target_system: u8,
22015 #[doc = "Component ID (0 for broadcast)."]
22016 pub target_component: u8,
22017 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22019 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22020 pub id_or_mac: [u8; 20],
22021 #[doc = "Indicates the type of authentication."]
22022 pub authentication_type: MavOdidAuthType,
22023 #[doc = "Allowed range is 0 - 15."]
22024 pub data_page: u8,
22025 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22026 pub last_page_index: u8,
22027 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22028 pub length: u8,
22029 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
22030 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22031 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22032 pub authentication_data: [u8; 23],
22033}
22034impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
22035 pub const ENCODED_LEN: usize = 53usize;
22036 pub const DEFAULT: Self = Self {
22037 timestamp: 0_u32,
22038 target_system: 0_u8,
22039 target_component: 0_u8,
22040 id_or_mac: [0_u8; 20usize],
22041 authentication_type: MavOdidAuthType::DEFAULT,
22042 data_page: 0_u8,
22043 last_page_index: 0_u8,
22044 length: 0_u8,
22045 authentication_data: [0_u8; 23usize],
22046 };
22047 #[cfg(feature = "arbitrary")]
22048 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22049 use arbitrary::{Arbitrary, Unstructured};
22050 let mut buf = [0u8; 1024];
22051 rng.fill_bytes(&mut buf);
22052 let mut unstructured = Unstructured::new(&buf);
22053 Self::arbitrary(&mut unstructured).unwrap_or_default()
22054 }
22055}
22056impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22057 fn default() -> Self {
22058 Self::DEFAULT.clone()
22059 }
22060}
22061impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22062 type Message = MavMessage;
22063 const ID: u32 = 12902u32;
22064 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
22065 const EXTRA_CRC: u8 = 140u8;
22066 const ENCODED_LEN: usize = 53usize;
22067 fn deser(
22068 _version: MavlinkVersion,
22069 __input: &[u8],
22070 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22071 let avail_len = __input.len();
22072 let mut payload_buf = [0; Self::ENCODED_LEN];
22073 let mut buf = if avail_len < Self::ENCODED_LEN {
22074 payload_buf[0..avail_len].copy_from_slice(__input);
22075 Bytes::new(&payload_buf)
22076 } else {
22077 Bytes::new(__input)
22078 };
22079 let mut __struct = Self::default();
22080 __struct.timestamp = buf.get_u32_le();
22081 __struct.target_system = buf.get_u8();
22082 __struct.target_component = buf.get_u8();
22083 for v in &mut __struct.id_or_mac {
22084 let val = buf.get_u8();
22085 *v = val;
22086 }
22087 let tmp = buf.get_u8();
22088 __struct.authentication_type =
22089 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22090 enum_type: "MavOdidAuthType",
22091 value: tmp as u32,
22092 })?;
22093 __struct.data_page = buf.get_u8();
22094 __struct.last_page_index = buf.get_u8();
22095 __struct.length = buf.get_u8();
22096 for v in &mut __struct.authentication_data {
22097 let val = buf.get_u8();
22098 *v = val;
22099 }
22100 Ok(__struct)
22101 }
22102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22103 let mut __tmp = BytesMut::new(bytes);
22104 #[allow(clippy::absurd_extreme_comparisons)]
22105 #[allow(unused_comparisons)]
22106 if __tmp.remaining() < Self::ENCODED_LEN {
22107 panic!(
22108 "buffer is too small (need {} bytes, but got {})",
22109 Self::ENCODED_LEN,
22110 __tmp.remaining(),
22111 )
22112 }
22113 __tmp.put_u32_le(self.timestamp);
22114 __tmp.put_u8(self.target_system);
22115 __tmp.put_u8(self.target_component);
22116 for val in &self.id_or_mac {
22117 __tmp.put_u8(*val);
22118 }
22119 __tmp.put_u8(self.authentication_type as u8);
22120 __tmp.put_u8(self.data_page);
22121 __tmp.put_u8(self.last_page_index);
22122 __tmp.put_u8(self.length);
22123 for val in &self.authentication_data {
22124 __tmp.put_u8(*val);
22125 }
22126 if matches!(version, MavlinkVersion::V2) {
22127 let len = __tmp.len();
22128 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22129 } else {
22130 __tmp.len()
22131 }
22132 }
22133}
22134#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22135#[doc = ""]
22136#[doc = "ID: 12900"]
22137#[derive(Debug, Clone, PartialEq)]
22138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22139#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22140#[cfg_attr(feature = "ts", derive(TS))]
22141#[cfg_attr(feature = "ts", ts(export))]
22142pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22143 #[doc = "System ID (0 for broadcast)."]
22144 pub target_system: u8,
22145 #[doc = "Component ID (0 for broadcast)."]
22146 pub target_component: u8,
22147 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22148 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22149 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22150 pub id_or_mac: [u8; 20],
22151 #[doc = "Indicates the format for the uas_id field of this message."]
22152 pub id_type: MavOdidIdType,
22153 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22154 pub ua_type: MavOdidUaType,
22155 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22156 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22157 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22158 pub uas_id: [u8; 20],
22159}
22160impl OPEN_DRONE_ID_BASIC_ID_DATA {
22161 pub const ENCODED_LEN: usize = 44usize;
22162 pub const DEFAULT: Self = Self {
22163 target_system: 0_u8,
22164 target_component: 0_u8,
22165 id_or_mac: [0_u8; 20usize],
22166 id_type: MavOdidIdType::DEFAULT,
22167 ua_type: MavOdidUaType::DEFAULT,
22168 uas_id: [0_u8; 20usize],
22169 };
22170 #[cfg(feature = "arbitrary")]
22171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22172 use arbitrary::{Arbitrary, Unstructured};
22173 let mut buf = [0u8; 1024];
22174 rng.fill_bytes(&mut buf);
22175 let mut unstructured = Unstructured::new(&buf);
22176 Self::arbitrary(&mut unstructured).unwrap_or_default()
22177 }
22178}
22179impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22180 fn default() -> Self {
22181 Self::DEFAULT.clone()
22182 }
22183}
22184impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22185 type Message = MavMessage;
22186 const ID: u32 = 12900u32;
22187 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22188 const EXTRA_CRC: u8 = 114u8;
22189 const ENCODED_LEN: usize = 44usize;
22190 fn deser(
22191 _version: MavlinkVersion,
22192 __input: &[u8],
22193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22194 let avail_len = __input.len();
22195 let mut payload_buf = [0; Self::ENCODED_LEN];
22196 let mut buf = if avail_len < Self::ENCODED_LEN {
22197 payload_buf[0..avail_len].copy_from_slice(__input);
22198 Bytes::new(&payload_buf)
22199 } else {
22200 Bytes::new(__input)
22201 };
22202 let mut __struct = Self::default();
22203 __struct.target_system = buf.get_u8();
22204 __struct.target_component = buf.get_u8();
22205 for v in &mut __struct.id_or_mac {
22206 let val = buf.get_u8();
22207 *v = val;
22208 }
22209 let tmp = buf.get_u8();
22210 __struct.id_type =
22211 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22212 enum_type: "MavOdidIdType",
22213 value: tmp as u32,
22214 })?;
22215 let tmp = buf.get_u8();
22216 __struct.ua_type =
22217 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22218 enum_type: "MavOdidUaType",
22219 value: tmp as u32,
22220 })?;
22221 for v in &mut __struct.uas_id {
22222 let val = buf.get_u8();
22223 *v = val;
22224 }
22225 Ok(__struct)
22226 }
22227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22228 let mut __tmp = BytesMut::new(bytes);
22229 #[allow(clippy::absurd_extreme_comparisons)]
22230 #[allow(unused_comparisons)]
22231 if __tmp.remaining() < Self::ENCODED_LEN {
22232 panic!(
22233 "buffer is too small (need {} bytes, but got {})",
22234 Self::ENCODED_LEN,
22235 __tmp.remaining(),
22236 )
22237 }
22238 __tmp.put_u8(self.target_system);
22239 __tmp.put_u8(self.target_component);
22240 for val in &self.id_or_mac {
22241 __tmp.put_u8(*val);
22242 }
22243 __tmp.put_u8(self.id_type as u8);
22244 __tmp.put_u8(self.ua_type as u8);
22245 for val in &self.uas_id {
22246 __tmp.put_u8(*val);
22247 }
22248 if matches!(version, MavlinkVersion::V2) {
22249 let len = __tmp.len();
22250 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22251 } else {
22252 __tmp.len()
22253 }
22254 }
22255}
22256#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22257#[doc = ""]
22258#[doc = "ID: 12901"]
22259#[derive(Debug, Clone, PartialEq)]
22260#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22262#[cfg_attr(feature = "ts", derive(TS))]
22263#[cfg_attr(feature = "ts", ts(export))]
22264pub struct OPEN_DRONE_ID_LOCATION_DATA {
22265 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22266 pub latitude: i32,
22267 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22268 pub longitude: i32,
22269 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22270 pub altitude_barometric: f32,
22271 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22272 pub altitude_geodetic: f32,
22273 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22274 pub height: f32,
22275 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22276 pub timestamp: f32,
22277 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22278 pub direction: u16,
22279 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22280 pub speed_horizontal: u16,
22281 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22282 pub speed_vertical: i16,
22283 #[doc = "System ID (0 for broadcast)."]
22284 pub target_system: u8,
22285 #[doc = "Component ID (0 for broadcast)."]
22286 pub target_component: u8,
22287 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22288 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22289 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22290 pub id_or_mac: [u8; 20],
22291 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22292 pub status: MavOdidStatus,
22293 #[doc = "Indicates the reference point for the height field."]
22294 pub height_reference: MavOdidHeightRef,
22295 #[doc = "The accuracy of the horizontal position."]
22296 pub horizontal_accuracy: MavOdidHorAcc,
22297 #[doc = "The accuracy of the vertical position."]
22298 pub vertical_accuracy: MavOdidVerAcc,
22299 #[doc = "The accuracy of the barometric altitude."]
22300 pub barometer_accuracy: MavOdidVerAcc,
22301 #[doc = "The accuracy of the horizontal and vertical speed."]
22302 pub speed_accuracy: MavOdidSpeedAcc,
22303 #[doc = "The accuracy of the timestamps."]
22304 pub timestamp_accuracy: MavOdidTimeAcc,
22305}
22306impl OPEN_DRONE_ID_LOCATION_DATA {
22307 pub const ENCODED_LEN: usize = 59usize;
22308 pub const DEFAULT: Self = Self {
22309 latitude: 0_i32,
22310 longitude: 0_i32,
22311 altitude_barometric: 0.0_f32,
22312 altitude_geodetic: 0.0_f32,
22313 height: 0.0_f32,
22314 timestamp: 0.0_f32,
22315 direction: 0_u16,
22316 speed_horizontal: 0_u16,
22317 speed_vertical: 0_i16,
22318 target_system: 0_u8,
22319 target_component: 0_u8,
22320 id_or_mac: [0_u8; 20usize],
22321 status: MavOdidStatus::DEFAULT,
22322 height_reference: MavOdidHeightRef::DEFAULT,
22323 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22324 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22325 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22326 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22327 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22328 };
22329 #[cfg(feature = "arbitrary")]
22330 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22331 use arbitrary::{Arbitrary, Unstructured};
22332 let mut buf = [0u8; 1024];
22333 rng.fill_bytes(&mut buf);
22334 let mut unstructured = Unstructured::new(&buf);
22335 Self::arbitrary(&mut unstructured).unwrap_or_default()
22336 }
22337}
22338impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22339 fn default() -> Self {
22340 Self::DEFAULT.clone()
22341 }
22342}
22343impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22344 type Message = MavMessage;
22345 const ID: u32 = 12901u32;
22346 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22347 const EXTRA_CRC: u8 = 254u8;
22348 const ENCODED_LEN: usize = 59usize;
22349 fn deser(
22350 _version: MavlinkVersion,
22351 __input: &[u8],
22352 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22353 let avail_len = __input.len();
22354 let mut payload_buf = [0; Self::ENCODED_LEN];
22355 let mut buf = if avail_len < Self::ENCODED_LEN {
22356 payload_buf[0..avail_len].copy_from_slice(__input);
22357 Bytes::new(&payload_buf)
22358 } else {
22359 Bytes::new(__input)
22360 };
22361 let mut __struct = Self::default();
22362 __struct.latitude = buf.get_i32_le();
22363 __struct.longitude = buf.get_i32_le();
22364 __struct.altitude_barometric = buf.get_f32_le();
22365 __struct.altitude_geodetic = buf.get_f32_le();
22366 __struct.height = buf.get_f32_le();
22367 __struct.timestamp = buf.get_f32_le();
22368 __struct.direction = buf.get_u16_le();
22369 __struct.speed_horizontal = buf.get_u16_le();
22370 __struct.speed_vertical = buf.get_i16_le();
22371 __struct.target_system = buf.get_u8();
22372 __struct.target_component = buf.get_u8();
22373 for v in &mut __struct.id_or_mac {
22374 let val = buf.get_u8();
22375 *v = val;
22376 }
22377 let tmp = buf.get_u8();
22378 __struct.status =
22379 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22380 enum_type: "MavOdidStatus",
22381 value: tmp as u32,
22382 })?;
22383 let tmp = buf.get_u8();
22384 __struct.height_reference =
22385 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22386 enum_type: "MavOdidHeightRef",
22387 value: tmp as u32,
22388 })?;
22389 let tmp = buf.get_u8();
22390 __struct.horizontal_accuracy =
22391 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22392 enum_type: "MavOdidHorAcc",
22393 value: tmp as u32,
22394 })?;
22395 let tmp = buf.get_u8();
22396 __struct.vertical_accuracy =
22397 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22398 enum_type: "MavOdidVerAcc",
22399 value: tmp as u32,
22400 })?;
22401 let tmp = buf.get_u8();
22402 __struct.barometer_accuracy =
22403 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22404 enum_type: "MavOdidVerAcc",
22405 value: tmp as u32,
22406 })?;
22407 let tmp = buf.get_u8();
22408 __struct.speed_accuracy =
22409 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22410 enum_type: "MavOdidSpeedAcc",
22411 value: tmp as u32,
22412 })?;
22413 let tmp = buf.get_u8();
22414 __struct.timestamp_accuracy =
22415 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22416 enum_type: "MavOdidTimeAcc",
22417 value: tmp as u32,
22418 })?;
22419 Ok(__struct)
22420 }
22421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22422 let mut __tmp = BytesMut::new(bytes);
22423 #[allow(clippy::absurd_extreme_comparisons)]
22424 #[allow(unused_comparisons)]
22425 if __tmp.remaining() < Self::ENCODED_LEN {
22426 panic!(
22427 "buffer is too small (need {} bytes, but got {})",
22428 Self::ENCODED_LEN,
22429 __tmp.remaining(),
22430 )
22431 }
22432 __tmp.put_i32_le(self.latitude);
22433 __tmp.put_i32_le(self.longitude);
22434 __tmp.put_f32_le(self.altitude_barometric);
22435 __tmp.put_f32_le(self.altitude_geodetic);
22436 __tmp.put_f32_le(self.height);
22437 __tmp.put_f32_le(self.timestamp);
22438 __tmp.put_u16_le(self.direction);
22439 __tmp.put_u16_le(self.speed_horizontal);
22440 __tmp.put_i16_le(self.speed_vertical);
22441 __tmp.put_u8(self.target_system);
22442 __tmp.put_u8(self.target_component);
22443 for val in &self.id_or_mac {
22444 __tmp.put_u8(*val);
22445 }
22446 __tmp.put_u8(self.status as u8);
22447 __tmp.put_u8(self.height_reference as u8);
22448 __tmp.put_u8(self.horizontal_accuracy as u8);
22449 __tmp.put_u8(self.vertical_accuracy as u8);
22450 __tmp.put_u8(self.barometer_accuracy as u8);
22451 __tmp.put_u8(self.speed_accuracy as u8);
22452 __tmp.put_u8(self.timestamp_accuracy as u8);
22453 if matches!(version, MavlinkVersion::V2) {
22454 let len = __tmp.len();
22455 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22456 } else {
22457 __tmp.len()
22458 }
22459 }
22460}
22461#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22462#[doc = ""]
22463#[doc = "ID: 12915"]
22464#[derive(Debug, Clone, PartialEq)]
22465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22467#[cfg_attr(feature = "ts", derive(TS))]
22468#[cfg_attr(feature = "ts", ts(export))]
22469pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22470 #[doc = "System ID (0 for broadcast)."]
22471 pub target_system: u8,
22472 #[doc = "Component ID (0 for broadcast)."]
22473 pub target_component: u8,
22474 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22475 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22476 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22477 pub id_or_mac: [u8; 20],
22478 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22479 pub single_message_size: u8,
22480 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22481 pub msg_pack_size: u8,
22482 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22483 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22484 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22485 pub messages: [u8; 225],
22486}
22487impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22488 pub const ENCODED_LEN: usize = 249usize;
22489 pub const DEFAULT: Self = Self {
22490 target_system: 0_u8,
22491 target_component: 0_u8,
22492 id_or_mac: [0_u8; 20usize],
22493 single_message_size: 0_u8,
22494 msg_pack_size: 0_u8,
22495 messages: [0_u8; 225usize],
22496 };
22497 #[cfg(feature = "arbitrary")]
22498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22499 use arbitrary::{Arbitrary, Unstructured};
22500 let mut buf = [0u8; 1024];
22501 rng.fill_bytes(&mut buf);
22502 let mut unstructured = Unstructured::new(&buf);
22503 Self::arbitrary(&mut unstructured).unwrap_or_default()
22504 }
22505}
22506impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22507 fn default() -> Self {
22508 Self::DEFAULT.clone()
22509 }
22510}
22511impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22512 type Message = MavMessage;
22513 const ID: u32 = 12915u32;
22514 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22515 const EXTRA_CRC: u8 = 94u8;
22516 const ENCODED_LEN: usize = 249usize;
22517 fn deser(
22518 _version: MavlinkVersion,
22519 __input: &[u8],
22520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22521 let avail_len = __input.len();
22522 let mut payload_buf = [0; Self::ENCODED_LEN];
22523 let mut buf = if avail_len < Self::ENCODED_LEN {
22524 payload_buf[0..avail_len].copy_from_slice(__input);
22525 Bytes::new(&payload_buf)
22526 } else {
22527 Bytes::new(__input)
22528 };
22529 let mut __struct = Self::default();
22530 __struct.target_system = buf.get_u8();
22531 __struct.target_component = buf.get_u8();
22532 for v in &mut __struct.id_or_mac {
22533 let val = buf.get_u8();
22534 *v = val;
22535 }
22536 __struct.single_message_size = buf.get_u8();
22537 __struct.msg_pack_size = buf.get_u8();
22538 for v in &mut __struct.messages {
22539 let val = buf.get_u8();
22540 *v = val;
22541 }
22542 Ok(__struct)
22543 }
22544 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22545 let mut __tmp = BytesMut::new(bytes);
22546 #[allow(clippy::absurd_extreme_comparisons)]
22547 #[allow(unused_comparisons)]
22548 if __tmp.remaining() < Self::ENCODED_LEN {
22549 panic!(
22550 "buffer is too small (need {} bytes, but got {})",
22551 Self::ENCODED_LEN,
22552 __tmp.remaining(),
22553 )
22554 }
22555 __tmp.put_u8(self.target_system);
22556 __tmp.put_u8(self.target_component);
22557 for val in &self.id_or_mac {
22558 __tmp.put_u8(*val);
22559 }
22560 __tmp.put_u8(self.single_message_size);
22561 __tmp.put_u8(self.msg_pack_size);
22562 for val in &self.messages {
22563 __tmp.put_u8(*val);
22564 }
22565 if matches!(version, MavlinkVersion::V2) {
22566 let len = __tmp.len();
22567 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22568 } else {
22569 __tmp.len()
22570 }
22571 }
22572}
22573#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22574#[doc = ""]
22575#[doc = "ID: 12905"]
22576#[derive(Debug, Clone, PartialEq)]
22577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22578#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22579#[cfg_attr(feature = "ts", derive(TS))]
22580#[cfg_attr(feature = "ts", ts(export))]
22581pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22582 #[doc = "System ID (0 for broadcast)."]
22583 pub target_system: u8,
22584 #[doc = "Component ID (0 for broadcast)."]
22585 pub target_component: u8,
22586 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22587 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22588 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22589 pub id_or_mac: [u8; 20],
22590 #[doc = "Indicates the type of the operator_id field."]
22591 pub operator_id_type: MavOdidOperatorIdType,
22592 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22593 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22594 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22595 pub operator_id: [u8; 20],
22596}
22597impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22598 pub const ENCODED_LEN: usize = 43usize;
22599 pub const DEFAULT: Self = Self {
22600 target_system: 0_u8,
22601 target_component: 0_u8,
22602 id_or_mac: [0_u8; 20usize],
22603 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22604 operator_id: [0_u8; 20usize],
22605 };
22606 #[cfg(feature = "arbitrary")]
22607 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22608 use arbitrary::{Arbitrary, Unstructured};
22609 let mut buf = [0u8; 1024];
22610 rng.fill_bytes(&mut buf);
22611 let mut unstructured = Unstructured::new(&buf);
22612 Self::arbitrary(&mut unstructured).unwrap_or_default()
22613 }
22614}
22615impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22616 fn default() -> Self {
22617 Self::DEFAULT.clone()
22618 }
22619}
22620impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22621 type Message = MavMessage;
22622 const ID: u32 = 12905u32;
22623 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22624 const EXTRA_CRC: u8 = 49u8;
22625 const ENCODED_LEN: usize = 43usize;
22626 fn deser(
22627 _version: MavlinkVersion,
22628 __input: &[u8],
22629 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22630 let avail_len = __input.len();
22631 let mut payload_buf = [0; Self::ENCODED_LEN];
22632 let mut buf = if avail_len < Self::ENCODED_LEN {
22633 payload_buf[0..avail_len].copy_from_slice(__input);
22634 Bytes::new(&payload_buf)
22635 } else {
22636 Bytes::new(__input)
22637 };
22638 let mut __struct = Self::default();
22639 __struct.target_system = buf.get_u8();
22640 __struct.target_component = buf.get_u8();
22641 for v in &mut __struct.id_or_mac {
22642 let val = buf.get_u8();
22643 *v = val;
22644 }
22645 let tmp = buf.get_u8();
22646 __struct.operator_id_type =
22647 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22648 enum_type: "MavOdidOperatorIdType",
22649 value: tmp as u32,
22650 })?;
22651 for v in &mut __struct.operator_id {
22652 let val = buf.get_u8();
22653 *v = val;
22654 }
22655 Ok(__struct)
22656 }
22657 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22658 let mut __tmp = BytesMut::new(bytes);
22659 #[allow(clippy::absurd_extreme_comparisons)]
22660 #[allow(unused_comparisons)]
22661 if __tmp.remaining() < Self::ENCODED_LEN {
22662 panic!(
22663 "buffer is too small (need {} bytes, but got {})",
22664 Self::ENCODED_LEN,
22665 __tmp.remaining(),
22666 )
22667 }
22668 __tmp.put_u8(self.target_system);
22669 __tmp.put_u8(self.target_component);
22670 for val in &self.id_or_mac {
22671 __tmp.put_u8(*val);
22672 }
22673 __tmp.put_u8(self.operator_id_type as u8);
22674 for val in &self.operator_id {
22675 __tmp.put_u8(*val);
22676 }
22677 if matches!(version, MavlinkVersion::V2) {
22678 let len = __tmp.len();
22679 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22680 } else {
22681 __tmp.len()
22682 }
22683 }
22684}
22685#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22686#[doc = ""]
22687#[doc = "ID: 12903"]
22688#[derive(Debug, Clone, PartialEq)]
22689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22691#[cfg_attr(feature = "ts", derive(TS))]
22692#[cfg_attr(feature = "ts", ts(export))]
22693pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22694 #[doc = "System ID (0 for broadcast)."]
22695 pub target_system: u8,
22696 #[doc = "Component ID (0 for broadcast)."]
22697 pub target_component: u8,
22698 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22699 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22700 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22701 pub id_or_mac: [u8; 20],
22702 #[doc = "Indicates the type of the description field."]
22703 pub description_type: MavOdidDescType,
22704 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22705 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22706 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22707 pub description: [u8; 23],
22708}
22709impl OPEN_DRONE_ID_SELF_ID_DATA {
22710 pub const ENCODED_LEN: usize = 46usize;
22711 pub const DEFAULT: Self = Self {
22712 target_system: 0_u8,
22713 target_component: 0_u8,
22714 id_or_mac: [0_u8; 20usize],
22715 description_type: MavOdidDescType::DEFAULT,
22716 description: [0_u8; 23usize],
22717 };
22718 #[cfg(feature = "arbitrary")]
22719 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22720 use arbitrary::{Arbitrary, Unstructured};
22721 let mut buf = [0u8; 1024];
22722 rng.fill_bytes(&mut buf);
22723 let mut unstructured = Unstructured::new(&buf);
22724 Self::arbitrary(&mut unstructured).unwrap_or_default()
22725 }
22726}
22727impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22728 fn default() -> Self {
22729 Self::DEFAULT.clone()
22730 }
22731}
22732impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22733 type Message = MavMessage;
22734 const ID: u32 = 12903u32;
22735 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22736 const EXTRA_CRC: u8 = 249u8;
22737 const ENCODED_LEN: usize = 46usize;
22738 fn deser(
22739 _version: MavlinkVersion,
22740 __input: &[u8],
22741 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22742 let avail_len = __input.len();
22743 let mut payload_buf = [0; Self::ENCODED_LEN];
22744 let mut buf = if avail_len < Self::ENCODED_LEN {
22745 payload_buf[0..avail_len].copy_from_slice(__input);
22746 Bytes::new(&payload_buf)
22747 } else {
22748 Bytes::new(__input)
22749 };
22750 let mut __struct = Self::default();
22751 __struct.target_system = buf.get_u8();
22752 __struct.target_component = buf.get_u8();
22753 for v in &mut __struct.id_or_mac {
22754 let val = buf.get_u8();
22755 *v = val;
22756 }
22757 let tmp = buf.get_u8();
22758 __struct.description_type =
22759 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22760 enum_type: "MavOdidDescType",
22761 value: tmp as u32,
22762 })?;
22763 for v in &mut __struct.description {
22764 let val = buf.get_u8();
22765 *v = val;
22766 }
22767 Ok(__struct)
22768 }
22769 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22770 let mut __tmp = BytesMut::new(bytes);
22771 #[allow(clippy::absurd_extreme_comparisons)]
22772 #[allow(unused_comparisons)]
22773 if __tmp.remaining() < Self::ENCODED_LEN {
22774 panic!(
22775 "buffer is too small (need {} bytes, but got {})",
22776 Self::ENCODED_LEN,
22777 __tmp.remaining(),
22778 )
22779 }
22780 __tmp.put_u8(self.target_system);
22781 __tmp.put_u8(self.target_component);
22782 for val in &self.id_or_mac {
22783 __tmp.put_u8(*val);
22784 }
22785 __tmp.put_u8(self.description_type as u8);
22786 for val in &self.description {
22787 __tmp.put_u8(*val);
22788 }
22789 if matches!(version, MavlinkVersion::V2) {
22790 let len = __tmp.len();
22791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22792 } else {
22793 __tmp.len()
22794 }
22795 }
22796}
22797#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22798#[doc = ""]
22799#[doc = "ID: 12904"]
22800#[derive(Debug, Clone, PartialEq)]
22801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22803#[cfg_attr(feature = "ts", derive(TS))]
22804#[cfg_attr(feature = "ts", ts(export))]
22805pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22806 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22807 pub operator_latitude: i32,
22808 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22809 pub operator_longitude: i32,
22810 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22811 pub area_ceiling: f32,
22812 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22813 pub area_floor: f32,
22814 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22815 pub operator_altitude_geo: f32,
22816 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22817 pub timestamp: u32,
22818 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22819 pub area_count: u16,
22820 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22821 pub area_radius: u16,
22822 #[doc = "System ID (0 for broadcast)."]
22823 pub target_system: u8,
22824 #[doc = "Component ID (0 for broadcast)."]
22825 pub target_component: u8,
22826 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22827 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22828 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22829 pub id_or_mac: [u8; 20],
22830 #[doc = "Specifies the operator location type."]
22831 pub operator_location_type: MavOdidOperatorLocationType,
22832 #[doc = "Specifies the classification type of the UA."]
22833 pub classification_type: MavOdidClassificationType,
22834 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22835 pub category_eu: MavOdidCategoryEu,
22836 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22837 pub class_eu: MavOdidClassEu,
22838}
22839impl OPEN_DRONE_ID_SYSTEM_DATA {
22840 pub const ENCODED_LEN: usize = 54usize;
22841 pub const DEFAULT: Self = Self {
22842 operator_latitude: 0_i32,
22843 operator_longitude: 0_i32,
22844 area_ceiling: 0.0_f32,
22845 area_floor: 0.0_f32,
22846 operator_altitude_geo: 0.0_f32,
22847 timestamp: 0_u32,
22848 area_count: 0_u16,
22849 area_radius: 0_u16,
22850 target_system: 0_u8,
22851 target_component: 0_u8,
22852 id_or_mac: [0_u8; 20usize],
22853 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22854 classification_type: MavOdidClassificationType::DEFAULT,
22855 category_eu: MavOdidCategoryEu::DEFAULT,
22856 class_eu: MavOdidClassEu::DEFAULT,
22857 };
22858 #[cfg(feature = "arbitrary")]
22859 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22860 use arbitrary::{Arbitrary, Unstructured};
22861 let mut buf = [0u8; 1024];
22862 rng.fill_bytes(&mut buf);
22863 let mut unstructured = Unstructured::new(&buf);
22864 Self::arbitrary(&mut unstructured).unwrap_or_default()
22865 }
22866}
22867impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22868 fn default() -> Self {
22869 Self::DEFAULT.clone()
22870 }
22871}
22872impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22873 type Message = MavMessage;
22874 const ID: u32 = 12904u32;
22875 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22876 const EXTRA_CRC: u8 = 77u8;
22877 const ENCODED_LEN: usize = 54usize;
22878 fn deser(
22879 _version: MavlinkVersion,
22880 __input: &[u8],
22881 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22882 let avail_len = __input.len();
22883 let mut payload_buf = [0; Self::ENCODED_LEN];
22884 let mut buf = if avail_len < Self::ENCODED_LEN {
22885 payload_buf[0..avail_len].copy_from_slice(__input);
22886 Bytes::new(&payload_buf)
22887 } else {
22888 Bytes::new(__input)
22889 };
22890 let mut __struct = Self::default();
22891 __struct.operator_latitude = buf.get_i32_le();
22892 __struct.operator_longitude = buf.get_i32_le();
22893 __struct.area_ceiling = buf.get_f32_le();
22894 __struct.area_floor = buf.get_f32_le();
22895 __struct.operator_altitude_geo = buf.get_f32_le();
22896 __struct.timestamp = buf.get_u32_le();
22897 __struct.area_count = buf.get_u16_le();
22898 __struct.area_radius = buf.get_u16_le();
22899 __struct.target_system = buf.get_u8();
22900 __struct.target_component = buf.get_u8();
22901 for v in &mut __struct.id_or_mac {
22902 let val = buf.get_u8();
22903 *v = val;
22904 }
22905 let tmp = buf.get_u8();
22906 __struct.operator_location_type =
22907 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22908 enum_type: "MavOdidOperatorLocationType",
22909 value: tmp as u32,
22910 })?;
22911 let tmp = buf.get_u8();
22912 __struct.classification_type =
22913 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22914 enum_type: "MavOdidClassificationType",
22915 value: tmp as u32,
22916 })?;
22917 let tmp = buf.get_u8();
22918 __struct.category_eu =
22919 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22920 enum_type: "MavOdidCategoryEu",
22921 value: tmp as u32,
22922 })?;
22923 let tmp = buf.get_u8();
22924 __struct.class_eu =
22925 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22926 enum_type: "MavOdidClassEu",
22927 value: tmp as u32,
22928 })?;
22929 Ok(__struct)
22930 }
22931 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22932 let mut __tmp = BytesMut::new(bytes);
22933 #[allow(clippy::absurd_extreme_comparisons)]
22934 #[allow(unused_comparisons)]
22935 if __tmp.remaining() < Self::ENCODED_LEN {
22936 panic!(
22937 "buffer is too small (need {} bytes, but got {})",
22938 Self::ENCODED_LEN,
22939 __tmp.remaining(),
22940 )
22941 }
22942 __tmp.put_i32_le(self.operator_latitude);
22943 __tmp.put_i32_le(self.operator_longitude);
22944 __tmp.put_f32_le(self.area_ceiling);
22945 __tmp.put_f32_le(self.area_floor);
22946 __tmp.put_f32_le(self.operator_altitude_geo);
22947 __tmp.put_u32_le(self.timestamp);
22948 __tmp.put_u16_le(self.area_count);
22949 __tmp.put_u16_le(self.area_radius);
22950 __tmp.put_u8(self.target_system);
22951 __tmp.put_u8(self.target_component);
22952 for val in &self.id_or_mac {
22953 __tmp.put_u8(*val);
22954 }
22955 __tmp.put_u8(self.operator_location_type as u8);
22956 __tmp.put_u8(self.classification_type as u8);
22957 __tmp.put_u8(self.category_eu as u8);
22958 __tmp.put_u8(self.class_eu as u8);
22959 if matches!(version, MavlinkVersion::V2) {
22960 let len = __tmp.len();
22961 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22962 } else {
22963 __tmp.len()
22964 }
22965 }
22966}
22967#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22968#[doc = ""]
22969#[doc = "ID: 12919"]
22970#[derive(Debug, Clone, PartialEq)]
22971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22973#[cfg_attr(feature = "ts", derive(TS))]
22974#[cfg_attr(feature = "ts", ts(export))]
22975pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22976 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22977 pub operator_latitude: i32,
22978 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22979 pub operator_longitude: i32,
22980 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22981 pub operator_altitude_geo: f32,
22982 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22983 pub timestamp: u32,
22984 #[doc = "System ID (0 for broadcast)."]
22985 pub target_system: u8,
22986 #[doc = "Component ID (0 for broadcast)."]
22987 pub target_component: u8,
22988}
22989impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22990 pub const ENCODED_LEN: usize = 18usize;
22991 pub const DEFAULT: Self = Self {
22992 operator_latitude: 0_i32,
22993 operator_longitude: 0_i32,
22994 operator_altitude_geo: 0.0_f32,
22995 timestamp: 0_u32,
22996 target_system: 0_u8,
22997 target_component: 0_u8,
22998 };
22999 #[cfg(feature = "arbitrary")]
23000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23001 use arbitrary::{Arbitrary, Unstructured};
23002 let mut buf = [0u8; 1024];
23003 rng.fill_bytes(&mut buf);
23004 let mut unstructured = Unstructured::new(&buf);
23005 Self::arbitrary(&mut unstructured).unwrap_or_default()
23006 }
23007}
23008impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23009 fn default() -> Self {
23010 Self::DEFAULT.clone()
23011 }
23012}
23013impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23014 type Message = MavMessage;
23015 const ID: u32 = 12919u32;
23016 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
23017 const EXTRA_CRC: u8 = 7u8;
23018 const ENCODED_LEN: usize = 18usize;
23019 fn deser(
23020 _version: MavlinkVersion,
23021 __input: &[u8],
23022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23023 let avail_len = __input.len();
23024 let mut payload_buf = [0; Self::ENCODED_LEN];
23025 let mut buf = if avail_len < Self::ENCODED_LEN {
23026 payload_buf[0..avail_len].copy_from_slice(__input);
23027 Bytes::new(&payload_buf)
23028 } else {
23029 Bytes::new(__input)
23030 };
23031 let mut __struct = Self::default();
23032 __struct.operator_latitude = buf.get_i32_le();
23033 __struct.operator_longitude = buf.get_i32_le();
23034 __struct.operator_altitude_geo = buf.get_f32_le();
23035 __struct.timestamp = buf.get_u32_le();
23036 __struct.target_system = buf.get_u8();
23037 __struct.target_component = buf.get_u8();
23038 Ok(__struct)
23039 }
23040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23041 let mut __tmp = BytesMut::new(bytes);
23042 #[allow(clippy::absurd_extreme_comparisons)]
23043 #[allow(unused_comparisons)]
23044 if __tmp.remaining() < Self::ENCODED_LEN {
23045 panic!(
23046 "buffer is too small (need {} bytes, but got {})",
23047 Self::ENCODED_LEN,
23048 __tmp.remaining(),
23049 )
23050 }
23051 __tmp.put_i32_le(self.operator_latitude);
23052 __tmp.put_i32_le(self.operator_longitude);
23053 __tmp.put_f32_le(self.operator_altitude_geo);
23054 __tmp.put_u32_le(self.timestamp);
23055 __tmp.put_u8(self.target_system);
23056 __tmp.put_u8(self.target_component);
23057 if matches!(version, MavlinkVersion::V2) {
23058 let len = __tmp.len();
23059 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23060 } else {
23061 __tmp.len()
23062 }
23063 }
23064}
23065#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
23066#[doc = ""]
23067#[doc = "ID: 100"]
23068#[derive(Debug, Clone, PartialEq)]
23069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23071#[cfg_attr(feature = "ts", derive(TS))]
23072#[cfg_attr(feature = "ts", ts(export))]
23073pub struct OPTICAL_FLOW_DATA {
23074 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23075 pub time_usec: u64,
23076 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
23077 pub flow_comp_m_x: f32,
23078 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
23079 pub flow_comp_m_y: f32,
23080 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
23081 pub ground_distance: f32,
23082 #[doc = "Flow in x-sensor direction"]
23083 pub flow_x: i16,
23084 #[doc = "Flow in y-sensor direction"]
23085 pub flow_y: i16,
23086 #[doc = "Sensor ID"]
23087 pub sensor_id: u8,
23088 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23089 pub quality: u8,
23090 #[doc = "Flow rate about X axis"]
23091 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23092 pub flow_rate_x: f32,
23093 #[doc = "Flow rate about Y axis"]
23094 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23095 pub flow_rate_y: f32,
23096}
23097impl OPTICAL_FLOW_DATA {
23098 pub const ENCODED_LEN: usize = 34usize;
23099 pub const DEFAULT: Self = Self {
23100 time_usec: 0_u64,
23101 flow_comp_m_x: 0.0_f32,
23102 flow_comp_m_y: 0.0_f32,
23103 ground_distance: 0.0_f32,
23104 flow_x: 0_i16,
23105 flow_y: 0_i16,
23106 sensor_id: 0_u8,
23107 quality: 0_u8,
23108 flow_rate_x: 0.0_f32,
23109 flow_rate_y: 0.0_f32,
23110 };
23111 #[cfg(feature = "arbitrary")]
23112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23113 use arbitrary::{Arbitrary, Unstructured};
23114 let mut buf = [0u8; 1024];
23115 rng.fill_bytes(&mut buf);
23116 let mut unstructured = Unstructured::new(&buf);
23117 Self::arbitrary(&mut unstructured).unwrap_or_default()
23118 }
23119}
23120impl Default for OPTICAL_FLOW_DATA {
23121 fn default() -> Self {
23122 Self::DEFAULT.clone()
23123 }
23124}
23125impl MessageData for OPTICAL_FLOW_DATA {
23126 type Message = MavMessage;
23127 const ID: u32 = 100u32;
23128 const NAME: &'static str = "OPTICAL_FLOW";
23129 const EXTRA_CRC: u8 = 175u8;
23130 const ENCODED_LEN: usize = 34usize;
23131 fn deser(
23132 _version: MavlinkVersion,
23133 __input: &[u8],
23134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23135 let avail_len = __input.len();
23136 let mut payload_buf = [0; Self::ENCODED_LEN];
23137 let mut buf = if avail_len < Self::ENCODED_LEN {
23138 payload_buf[0..avail_len].copy_from_slice(__input);
23139 Bytes::new(&payload_buf)
23140 } else {
23141 Bytes::new(__input)
23142 };
23143 let mut __struct = Self::default();
23144 __struct.time_usec = buf.get_u64_le();
23145 __struct.flow_comp_m_x = buf.get_f32_le();
23146 __struct.flow_comp_m_y = buf.get_f32_le();
23147 __struct.ground_distance = buf.get_f32_le();
23148 __struct.flow_x = buf.get_i16_le();
23149 __struct.flow_y = buf.get_i16_le();
23150 __struct.sensor_id = buf.get_u8();
23151 __struct.quality = buf.get_u8();
23152 __struct.flow_rate_x = buf.get_f32_le();
23153 __struct.flow_rate_y = buf.get_f32_le();
23154 Ok(__struct)
23155 }
23156 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23157 let mut __tmp = BytesMut::new(bytes);
23158 #[allow(clippy::absurd_extreme_comparisons)]
23159 #[allow(unused_comparisons)]
23160 if __tmp.remaining() < Self::ENCODED_LEN {
23161 panic!(
23162 "buffer is too small (need {} bytes, but got {})",
23163 Self::ENCODED_LEN,
23164 __tmp.remaining(),
23165 )
23166 }
23167 __tmp.put_u64_le(self.time_usec);
23168 __tmp.put_f32_le(self.flow_comp_m_x);
23169 __tmp.put_f32_le(self.flow_comp_m_y);
23170 __tmp.put_f32_le(self.ground_distance);
23171 __tmp.put_i16_le(self.flow_x);
23172 __tmp.put_i16_le(self.flow_y);
23173 __tmp.put_u8(self.sensor_id);
23174 __tmp.put_u8(self.quality);
23175 if matches!(version, MavlinkVersion::V2) {
23176 __tmp.put_f32_le(self.flow_rate_x);
23177 __tmp.put_f32_le(self.flow_rate_y);
23178 let len = __tmp.len();
23179 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23180 } else {
23181 __tmp.len()
23182 }
23183 }
23184}
23185#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23186#[doc = ""]
23187#[doc = "ID: 106"]
23188#[derive(Debug, Clone, PartialEq)]
23189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23190#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23191#[cfg_attr(feature = "ts", derive(TS))]
23192#[cfg_attr(feature = "ts", ts(export))]
23193pub struct OPTICAL_FLOW_RAD_DATA {
23194 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23195 pub time_usec: u64,
23196 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23197 pub integration_time_us: u32,
23198 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23199 pub integrated_x: f32,
23200 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
23201 pub integrated_y: f32,
23202 #[doc = "RH rotation around X axis"]
23203 pub integrated_xgyro: f32,
23204 #[doc = "RH rotation around Y axis"]
23205 pub integrated_ygyro: f32,
23206 #[doc = "RH rotation around Z axis"]
23207 pub integrated_zgyro: f32,
23208 #[doc = "Time since the distance was sampled."]
23209 pub time_delta_distance_us: u32,
23210 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
23211 pub distance: f32,
23212 #[doc = "Temperature"]
23213 pub temperature: i16,
23214 #[doc = "Sensor ID"]
23215 pub sensor_id: u8,
23216 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
23217 pub quality: u8,
23218}
23219impl OPTICAL_FLOW_RAD_DATA {
23220 pub const ENCODED_LEN: usize = 44usize;
23221 pub const DEFAULT: Self = Self {
23222 time_usec: 0_u64,
23223 integration_time_us: 0_u32,
23224 integrated_x: 0.0_f32,
23225 integrated_y: 0.0_f32,
23226 integrated_xgyro: 0.0_f32,
23227 integrated_ygyro: 0.0_f32,
23228 integrated_zgyro: 0.0_f32,
23229 time_delta_distance_us: 0_u32,
23230 distance: 0.0_f32,
23231 temperature: 0_i16,
23232 sensor_id: 0_u8,
23233 quality: 0_u8,
23234 };
23235 #[cfg(feature = "arbitrary")]
23236 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23237 use arbitrary::{Arbitrary, Unstructured};
23238 let mut buf = [0u8; 1024];
23239 rng.fill_bytes(&mut buf);
23240 let mut unstructured = Unstructured::new(&buf);
23241 Self::arbitrary(&mut unstructured).unwrap_or_default()
23242 }
23243}
23244impl Default for OPTICAL_FLOW_RAD_DATA {
23245 fn default() -> Self {
23246 Self::DEFAULT.clone()
23247 }
23248}
23249impl MessageData for OPTICAL_FLOW_RAD_DATA {
23250 type Message = MavMessage;
23251 const ID: u32 = 106u32;
23252 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23253 const EXTRA_CRC: u8 = 138u8;
23254 const ENCODED_LEN: usize = 44usize;
23255 fn deser(
23256 _version: MavlinkVersion,
23257 __input: &[u8],
23258 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23259 let avail_len = __input.len();
23260 let mut payload_buf = [0; Self::ENCODED_LEN];
23261 let mut buf = if avail_len < Self::ENCODED_LEN {
23262 payload_buf[0..avail_len].copy_from_slice(__input);
23263 Bytes::new(&payload_buf)
23264 } else {
23265 Bytes::new(__input)
23266 };
23267 let mut __struct = Self::default();
23268 __struct.time_usec = buf.get_u64_le();
23269 __struct.integration_time_us = buf.get_u32_le();
23270 __struct.integrated_x = buf.get_f32_le();
23271 __struct.integrated_y = buf.get_f32_le();
23272 __struct.integrated_xgyro = buf.get_f32_le();
23273 __struct.integrated_ygyro = buf.get_f32_le();
23274 __struct.integrated_zgyro = buf.get_f32_le();
23275 __struct.time_delta_distance_us = buf.get_u32_le();
23276 __struct.distance = buf.get_f32_le();
23277 __struct.temperature = buf.get_i16_le();
23278 __struct.sensor_id = buf.get_u8();
23279 __struct.quality = buf.get_u8();
23280 Ok(__struct)
23281 }
23282 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23283 let mut __tmp = BytesMut::new(bytes);
23284 #[allow(clippy::absurd_extreme_comparisons)]
23285 #[allow(unused_comparisons)]
23286 if __tmp.remaining() < Self::ENCODED_LEN {
23287 panic!(
23288 "buffer is too small (need {} bytes, but got {})",
23289 Self::ENCODED_LEN,
23290 __tmp.remaining(),
23291 )
23292 }
23293 __tmp.put_u64_le(self.time_usec);
23294 __tmp.put_u32_le(self.integration_time_us);
23295 __tmp.put_f32_le(self.integrated_x);
23296 __tmp.put_f32_le(self.integrated_y);
23297 __tmp.put_f32_le(self.integrated_xgyro);
23298 __tmp.put_f32_le(self.integrated_ygyro);
23299 __tmp.put_f32_le(self.integrated_zgyro);
23300 __tmp.put_u32_le(self.time_delta_distance_us);
23301 __tmp.put_f32_le(self.distance);
23302 __tmp.put_i16_le(self.temperature);
23303 __tmp.put_u8(self.sensor_id);
23304 __tmp.put_u8(self.quality);
23305 if matches!(version, MavlinkVersion::V2) {
23306 let len = __tmp.len();
23307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23308 } else {
23309 __tmp.len()
23310 }
23311 }
23312}
23313#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23314#[doc = ""]
23315#[doc = "ID: 360"]
23316#[derive(Debug, Clone, PartialEq)]
23317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23319#[cfg_attr(feature = "ts", derive(TS))]
23320#[cfg_attr(feature = "ts", ts(export))]
23321pub struct ORBIT_EXECUTION_STATUS_DATA {
23322 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23323 pub time_usec: u64,
23324 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23325 pub radius: f32,
23326 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23327 pub x: i32,
23328 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23329 pub y: i32,
23330 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23331 pub z: f32,
23332 #[doc = "The coordinate system of the fields: x, y, z."]
23333 pub frame: MavFrame,
23334}
23335impl ORBIT_EXECUTION_STATUS_DATA {
23336 pub const ENCODED_LEN: usize = 25usize;
23337 pub const DEFAULT: Self = Self {
23338 time_usec: 0_u64,
23339 radius: 0.0_f32,
23340 x: 0_i32,
23341 y: 0_i32,
23342 z: 0.0_f32,
23343 frame: MavFrame::DEFAULT,
23344 };
23345 #[cfg(feature = "arbitrary")]
23346 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23347 use arbitrary::{Arbitrary, Unstructured};
23348 let mut buf = [0u8; 1024];
23349 rng.fill_bytes(&mut buf);
23350 let mut unstructured = Unstructured::new(&buf);
23351 Self::arbitrary(&mut unstructured).unwrap_or_default()
23352 }
23353}
23354impl Default for ORBIT_EXECUTION_STATUS_DATA {
23355 fn default() -> Self {
23356 Self::DEFAULT.clone()
23357 }
23358}
23359impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23360 type Message = MavMessage;
23361 const ID: u32 = 360u32;
23362 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23363 const EXTRA_CRC: u8 = 11u8;
23364 const ENCODED_LEN: usize = 25usize;
23365 fn deser(
23366 _version: MavlinkVersion,
23367 __input: &[u8],
23368 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23369 let avail_len = __input.len();
23370 let mut payload_buf = [0; Self::ENCODED_LEN];
23371 let mut buf = if avail_len < Self::ENCODED_LEN {
23372 payload_buf[0..avail_len].copy_from_slice(__input);
23373 Bytes::new(&payload_buf)
23374 } else {
23375 Bytes::new(__input)
23376 };
23377 let mut __struct = Self::default();
23378 __struct.time_usec = buf.get_u64_le();
23379 __struct.radius = buf.get_f32_le();
23380 __struct.x = buf.get_i32_le();
23381 __struct.y = buf.get_i32_le();
23382 __struct.z = buf.get_f32_le();
23383 let tmp = buf.get_u8();
23384 __struct.frame =
23385 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23386 enum_type: "MavFrame",
23387 value: tmp as u32,
23388 })?;
23389 Ok(__struct)
23390 }
23391 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23392 let mut __tmp = BytesMut::new(bytes);
23393 #[allow(clippy::absurd_extreme_comparisons)]
23394 #[allow(unused_comparisons)]
23395 if __tmp.remaining() < Self::ENCODED_LEN {
23396 panic!(
23397 "buffer is too small (need {} bytes, but got {})",
23398 Self::ENCODED_LEN,
23399 __tmp.remaining(),
23400 )
23401 }
23402 __tmp.put_u64_le(self.time_usec);
23403 __tmp.put_f32_le(self.radius);
23404 __tmp.put_i32_le(self.x);
23405 __tmp.put_i32_le(self.y);
23406 __tmp.put_f32_le(self.z);
23407 __tmp.put_u8(self.frame as u8);
23408 if matches!(version, MavlinkVersion::V2) {
23409 let len = __tmp.len();
23410 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23411 } else {
23412 __tmp.len()
23413 }
23414 }
23415}
23416#[doc = "Response from a PARAM_EXT_SET message."]
23417#[doc = ""]
23418#[doc = "ID: 324"]
23419#[derive(Debug, Clone, PartialEq)]
23420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23422#[cfg_attr(feature = "ts", derive(TS))]
23423#[cfg_attr(feature = "ts", ts(export))]
23424pub struct PARAM_EXT_ACK_DATA {
23425 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23426 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23427 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23428 pub param_id: [u8; 16],
23429 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23430 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23431 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23432 pub param_value: [u8; 128],
23433 #[doc = "Parameter type."]
23434 pub param_type: MavParamExtType,
23435 #[doc = "Result code."]
23436 pub param_result: ParamAck,
23437}
23438impl PARAM_EXT_ACK_DATA {
23439 pub const ENCODED_LEN: usize = 146usize;
23440 pub const DEFAULT: Self = Self {
23441 param_id: [0_u8; 16usize],
23442 param_value: [0_u8; 128usize],
23443 param_type: MavParamExtType::DEFAULT,
23444 param_result: ParamAck::DEFAULT,
23445 };
23446 #[cfg(feature = "arbitrary")]
23447 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23448 use arbitrary::{Arbitrary, Unstructured};
23449 let mut buf = [0u8; 1024];
23450 rng.fill_bytes(&mut buf);
23451 let mut unstructured = Unstructured::new(&buf);
23452 Self::arbitrary(&mut unstructured).unwrap_or_default()
23453 }
23454}
23455impl Default for PARAM_EXT_ACK_DATA {
23456 fn default() -> Self {
23457 Self::DEFAULT.clone()
23458 }
23459}
23460impl MessageData for PARAM_EXT_ACK_DATA {
23461 type Message = MavMessage;
23462 const ID: u32 = 324u32;
23463 const NAME: &'static str = "PARAM_EXT_ACK";
23464 const EXTRA_CRC: u8 = 132u8;
23465 const ENCODED_LEN: usize = 146usize;
23466 fn deser(
23467 _version: MavlinkVersion,
23468 __input: &[u8],
23469 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23470 let avail_len = __input.len();
23471 let mut payload_buf = [0; Self::ENCODED_LEN];
23472 let mut buf = if avail_len < Self::ENCODED_LEN {
23473 payload_buf[0..avail_len].copy_from_slice(__input);
23474 Bytes::new(&payload_buf)
23475 } else {
23476 Bytes::new(__input)
23477 };
23478 let mut __struct = Self::default();
23479 for v in &mut __struct.param_id {
23480 let val = buf.get_u8();
23481 *v = val;
23482 }
23483 for v in &mut __struct.param_value {
23484 let val = buf.get_u8();
23485 *v = val;
23486 }
23487 let tmp = buf.get_u8();
23488 __struct.param_type =
23489 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23490 enum_type: "MavParamExtType",
23491 value: tmp as u32,
23492 })?;
23493 let tmp = buf.get_u8();
23494 __struct.param_result =
23495 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23496 enum_type: "ParamAck",
23497 value: tmp as u32,
23498 })?;
23499 Ok(__struct)
23500 }
23501 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23502 let mut __tmp = BytesMut::new(bytes);
23503 #[allow(clippy::absurd_extreme_comparisons)]
23504 #[allow(unused_comparisons)]
23505 if __tmp.remaining() < Self::ENCODED_LEN {
23506 panic!(
23507 "buffer is too small (need {} bytes, but got {})",
23508 Self::ENCODED_LEN,
23509 __tmp.remaining(),
23510 )
23511 }
23512 for val in &self.param_id {
23513 __tmp.put_u8(*val);
23514 }
23515 for val in &self.param_value {
23516 __tmp.put_u8(*val);
23517 }
23518 __tmp.put_u8(self.param_type as u8);
23519 __tmp.put_u8(self.param_result as u8);
23520 if matches!(version, MavlinkVersion::V2) {
23521 let len = __tmp.len();
23522 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23523 } else {
23524 __tmp.len()
23525 }
23526 }
23527}
23528#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23529#[doc = ""]
23530#[doc = "ID: 321"]
23531#[derive(Debug, Clone, PartialEq)]
23532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23533#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23534#[cfg_attr(feature = "ts", derive(TS))]
23535#[cfg_attr(feature = "ts", ts(export))]
23536pub struct PARAM_EXT_REQUEST_LIST_DATA {
23537 #[doc = "System ID"]
23538 pub target_system: u8,
23539 #[doc = "Component ID"]
23540 pub target_component: u8,
23541}
23542impl PARAM_EXT_REQUEST_LIST_DATA {
23543 pub const ENCODED_LEN: usize = 2usize;
23544 pub const DEFAULT: Self = Self {
23545 target_system: 0_u8,
23546 target_component: 0_u8,
23547 };
23548 #[cfg(feature = "arbitrary")]
23549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23550 use arbitrary::{Arbitrary, Unstructured};
23551 let mut buf = [0u8; 1024];
23552 rng.fill_bytes(&mut buf);
23553 let mut unstructured = Unstructured::new(&buf);
23554 Self::arbitrary(&mut unstructured).unwrap_or_default()
23555 }
23556}
23557impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23558 fn default() -> Self {
23559 Self::DEFAULT.clone()
23560 }
23561}
23562impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23563 type Message = MavMessage;
23564 const ID: u32 = 321u32;
23565 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23566 const EXTRA_CRC: u8 = 88u8;
23567 const ENCODED_LEN: usize = 2usize;
23568 fn deser(
23569 _version: MavlinkVersion,
23570 __input: &[u8],
23571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23572 let avail_len = __input.len();
23573 let mut payload_buf = [0; Self::ENCODED_LEN];
23574 let mut buf = if avail_len < Self::ENCODED_LEN {
23575 payload_buf[0..avail_len].copy_from_slice(__input);
23576 Bytes::new(&payload_buf)
23577 } else {
23578 Bytes::new(__input)
23579 };
23580 let mut __struct = Self::default();
23581 __struct.target_system = buf.get_u8();
23582 __struct.target_component = buf.get_u8();
23583 Ok(__struct)
23584 }
23585 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23586 let mut __tmp = BytesMut::new(bytes);
23587 #[allow(clippy::absurd_extreme_comparisons)]
23588 #[allow(unused_comparisons)]
23589 if __tmp.remaining() < Self::ENCODED_LEN {
23590 panic!(
23591 "buffer is too small (need {} bytes, but got {})",
23592 Self::ENCODED_LEN,
23593 __tmp.remaining(),
23594 )
23595 }
23596 __tmp.put_u8(self.target_system);
23597 __tmp.put_u8(self.target_component);
23598 if matches!(version, MavlinkVersion::V2) {
23599 let len = __tmp.len();
23600 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23601 } else {
23602 __tmp.len()
23603 }
23604 }
23605}
23606#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23607#[doc = ""]
23608#[doc = "ID: 320"]
23609#[derive(Debug, Clone, PartialEq)]
23610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23611#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23612#[cfg_attr(feature = "ts", derive(TS))]
23613#[cfg_attr(feature = "ts", ts(export))]
23614pub struct PARAM_EXT_REQUEST_READ_DATA {
23615 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23616 pub param_index: i16,
23617 #[doc = "System ID"]
23618 pub target_system: u8,
23619 #[doc = "Component ID"]
23620 pub target_component: u8,
23621 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23622 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23623 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23624 pub param_id: [u8; 16],
23625}
23626impl PARAM_EXT_REQUEST_READ_DATA {
23627 pub const ENCODED_LEN: usize = 20usize;
23628 pub const DEFAULT: Self = Self {
23629 param_index: 0_i16,
23630 target_system: 0_u8,
23631 target_component: 0_u8,
23632 param_id: [0_u8; 16usize],
23633 };
23634 #[cfg(feature = "arbitrary")]
23635 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23636 use arbitrary::{Arbitrary, Unstructured};
23637 let mut buf = [0u8; 1024];
23638 rng.fill_bytes(&mut buf);
23639 let mut unstructured = Unstructured::new(&buf);
23640 Self::arbitrary(&mut unstructured).unwrap_or_default()
23641 }
23642}
23643impl Default for PARAM_EXT_REQUEST_READ_DATA {
23644 fn default() -> Self {
23645 Self::DEFAULT.clone()
23646 }
23647}
23648impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23649 type Message = MavMessage;
23650 const ID: u32 = 320u32;
23651 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23652 const EXTRA_CRC: u8 = 243u8;
23653 const ENCODED_LEN: usize = 20usize;
23654 fn deser(
23655 _version: MavlinkVersion,
23656 __input: &[u8],
23657 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23658 let avail_len = __input.len();
23659 let mut payload_buf = [0; Self::ENCODED_LEN];
23660 let mut buf = if avail_len < Self::ENCODED_LEN {
23661 payload_buf[0..avail_len].copy_from_slice(__input);
23662 Bytes::new(&payload_buf)
23663 } else {
23664 Bytes::new(__input)
23665 };
23666 let mut __struct = Self::default();
23667 __struct.param_index = buf.get_i16_le();
23668 __struct.target_system = buf.get_u8();
23669 __struct.target_component = buf.get_u8();
23670 for v in &mut __struct.param_id {
23671 let val = buf.get_u8();
23672 *v = val;
23673 }
23674 Ok(__struct)
23675 }
23676 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23677 let mut __tmp = BytesMut::new(bytes);
23678 #[allow(clippy::absurd_extreme_comparisons)]
23679 #[allow(unused_comparisons)]
23680 if __tmp.remaining() < Self::ENCODED_LEN {
23681 panic!(
23682 "buffer is too small (need {} bytes, but got {})",
23683 Self::ENCODED_LEN,
23684 __tmp.remaining(),
23685 )
23686 }
23687 __tmp.put_i16_le(self.param_index);
23688 __tmp.put_u8(self.target_system);
23689 __tmp.put_u8(self.target_component);
23690 for val in &self.param_id {
23691 __tmp.put_u8(*val);
23692 }
23693 if matches!(version, MavlinkVersion::V2) {
23694 let len = __tmp.len();
23695 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23696 } else {
23697 __tmp.len()
23698 }
23699 }
23700}
23701#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23702#[doc = ""]
23703#[doc = "ID: 323"]
23704#[derive(Debug, Clone, PartialEq)]
23705#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23706#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23707#[cfg_attr(feature = "ts", derive(TS))]
23708#[cfg_attr(feature = "ts", ts(export))]
23709pub struct PARAM_EXT_SET_DATA {
23710 #[doc = "System ID"]
23711 pub target_system: u8,
23712 #[doc = "Component ID"]
23713 pub target_component: u8,
23714 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23715 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23716 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23717 pub param_id: [u8; 16],
23718 #[doc = "Parameter value"]
23719 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23720 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23721 pub param_value: [u8; 128],
23722 #[doc = "Parameter type."]
23723 pub param_type: MavParamExtType,
23724}
23725impl PARAM_EXT_SET_DATA {
23726 pub const ENCODED_LEN: usize = 147usize;
23727 pub const DEFAULT: Self = Self {
23728 target_system: 0_u8,
23729 target_component: 0_u8,
23730 param_id: [0_u8; 16usize],
23731 param_value: [0_u8; 128usize],
23732 param_type: MavParamExtType::DEFAULT,
23733 };
23734 #[cfg(feature = "arbitrary")]
23735 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23736 use arbitrary::{Arbitrary, Unstructured};
23737 let mut buf = [0u8; 1024];
23738 rng.fill_bytes(&mut buf);
23739 let mut unstructured = Unstructured::new(&buf);
23740 Self::arbitrary(&mut unstructured).unwrap_or_default()
23741 }
23742}
23743impl Default for PARAM_EXT_SET_DATA {
23744 fn default() -> Self {
23745 Self::DEFAULT.clone()
23746 }
23747}
23748impl MessageData for PARAM_EXT_SET_DATA {
23749 type Message = MavMessage;
23750 const ID: u32 = 323u32;
23751 const NAME: &'static str = "PARAM_EXT_SET";
23752 const EXTRA_CRC: u8 = 78u8;
23753 const ENCODED_LEN: usize = 147usize;
23754 fn deser(
23755 _version: MavlinkVersion,
23756 __input: &[u8],
23757 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23758 let avail_len = __input.len();
23759 let mut payload_buf = [0; Self::ENCODED_LEN];
23760 let mut buf = if avail_len < Self::ENCODED_LEN {
23761 payload_buf[0..avail_len].copy_from_slice(__input);
23762 Bytes::new(&payload_buf)
23763 } else {
23764 Bytes::new(__input)
23765 };
23766 let mut __struct = Self::default();
23767 __struct.target_system = buf.get_u8();
23768 __struct.target_component = buf.get_u8();
23769 for v in &mut __struct.param_id {
23770 let val = buf.get_u8();
23771 *v = val;
23772 }
23773 for v in &mut __struct.param_value {
23774 let val = buf.get_u8();
23775 *v = val;
23776 }
23777 let tmp = buf.get_u8();
23778 __struct.param_type =
23779 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23780 enum_type: "MavParamExtType",
23781 value: tmp as u32,
23782 })?;
23783 Ok(__struct)
23784 }
23785 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23786 let mut __tmp = BytesMut::new(bytes);
23787 #[allow(clippy::absurd_extreme_comparisons)]
23788 #[allow(unused_comparisons)]
23789 if __tmp.remaining() < Self::ENCODED_LEN {
23790 panic!(
23791 "buffer is too small (need {} bytes, but got {})",
23792 Self::ENCODED_LEN,
23793 __tmp.remaining(),
23794 )
23795 }
23796 __tmp.put_u8(self.target_system);
23797 __tmp.put_u8(self.target_component);
23798 for val in &self.param_id {
23799 __tmp.put_u8(*val);
23800 }
23801 for val in &self.param_value {
23802 __tmp.put_u8(*val);
23803 }
23804 __tmp.put_u8(self.param_type as u8);
23805 if matches!(version, MavlinkVersion::V2) {
23806 let len = __tmp.len();
23807 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23808 } else {
23809 __tmp.len()
23810 }
23811 }
23812}
23813#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23814#[doc = ""]
23815#[doc = "ID: 322"]
23816#[derive(Debug, Clone, PartialEq)]
23817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23819#[cfg_attr(feature = "ts", derive(TS))]
23820#[cfg_attr(feature = "ts", ts(export))]
23821pub struct PARAM_EXT_VALUE_DATA {
23822 #[doc = "Total number of parameters"]
23823 pub param_count: u16,
23824 #[doc = "Index of this parameter"]
23825 pub param_index: u16,
23826 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23827 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23828 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23829 pub param_id: [u8; 16],
23830 #[doc = "Parameter value"]
23831 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23832 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23833 pub param_value: [u8; 128],
23834 #[doc = "Parameter type."]
23835 pub param_type: MavParamExtType,
23836}
23837impl PARAM_EXT_VALUE_DATA {
23838 pub const ENCODED_LEN: usize = 149usize;
23839 pub const DEFAULT: Self = Self {
23840 param_count: 0_u16,
23841 param_index: 0_u16,
23842 param_id: [0_u8; 16usize],
23843 param_value: [0_u8; 128usize],
23844 param_type: MavParamExtType::DEFAULT,
23845 };
23846 #[cfg(feature = "arbitrary")]
23847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23848 use arbitrary::{Arbitrary, Unstructured};
23849 let mut buf = [0u8; 1024];
23850 rng.fill_bytes(&mut buf);
23851 let mut unstructured = Unstructured::new(&buf);
23852 Self::arbitrary(&mut unstructured).unwrap_or_default()
23853 }
23854}
23855impl Default for PARAM_EXT_VALUE_DATA {
23856 fn default() -> Self {
23857 Self::DEFAULT.clone()
23858 }
23859}
23860impl MessageData for PARAM_EXT_VALUE_DATA {
23861 type Message = MavMessage;
23862 const ID: u32 = 322u32;
23863 const NAME: &'static str = "PARAM_EXT_VALUE";
23864 const EXTRA_CRC: u8 = 243u8;
23865 const ENCODED_LEN: usize = 149usize;
23866 fn deser(
23867 _version: MavlinkVersion,
23868 __input: &[u8],
23869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23870 let avail_len = __input.len();
23871 let mut payload_buf = [0; Self::ENCODED_LEN];
23872 let mut buf = if avail_len < Self::ENCODED_LEN {
23873 payload_buf[0..avail_len].copy_from_slice(__input);
23874 Bytes::new(&payload_buf)
23875 } else {
23876 Bytes::new(__input)
23877 };
23878 let mut __struct = Self::default();
23879 __struct.param_count = buf.get_u16_le();
23880 __struct.param_index = buf.get_u16_le();
23881 for v in &mut __struct.param_id {
23882 let val = buf.get_u8();
23883 *v = val;
23884 }
23885 for v in &mut __struct.param_value {
23886 let val = buf.get_u8();
23887 *v = val;
23888 }
23889 let tmp = buf.get_u8();
23890 __struct.param_type =
23891 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23892 enum_type: "MavParamExtType",
23893 value: tmp as u32,
23894 })?;
23895 Ok(__struct)
23896 }
23897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23898 let mut __tmp = BytesMut::new(bytes);
23899 #[allow(clippy::absurd_extreme_comparisons)]
23900 #[allow(unused_comparisons)]
23901 if __tmp.remaining() < Self::ENCODED_LEN {
23902 panic!(
23903 "buffer is too small (need {} bytes, but got {})",
23904 Self::ENCODED_LEN,
23905 __tmp.remaining(),
23906 )
23907 }
23908 __tmp.put_u16_le(self.param_count);
23909 __tmp.put_u16_le(self.param_index);
23910 for val in &self.param_id {
23911 __tmp.put_u8(*val);
23912 }
23913 for val in &self.param_value {
23914 __tmp.put_u8(*val);
23915 }
23916 __tmp.put_u8(self.param_type as u8);
23917 if matches!(version, MavlinkVersion::V2) {
23918 let len = __tmp.len();
23919 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23920 } else {
23921 __tmp.len()
23922 }
23923 }
23924}
23925#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23926#[doc = ""]
23927#[doc = "ID: 50"]
23928#[derive(Debug, Clone, PartialEq)]
23929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23930#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23931#[cfg_attr(feature = "ts", derive(TS))]
23932#[cfg_attr(feature = "ts", ts(export))]
23933pub struct PARAM_MAP_RC_DATA {
23934 #[doc = "Initial parameter value"]
23935 pub param_value0: f32,
23936 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23937 pub scale: f32,
23938 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23939 pub param_value_min: f32,
23940 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23941 pub param_value_max: f32,
23942 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23943 pub param_index: i16,
23944 #[doc = "System ID"]
23945 pub target_system: u8,
23946 #[doc = "Component ID"]
23947 pub target_component: u8,
23948 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23949 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23950 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23951 pub param_id: [u8; 16],
23952 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23953 pub parameter_rc_channel_index: u8,
23954}
23955impl PARAM_MAP_RC_DATA {
23956 pub const ENCODED_LEN: usize = 37usize;
23957 pub const DEFAULT: Self = Self {
23958 param_value0: 0.0_f32,
23959 scale: 0.0_f32,
23960 param_value_min: 0.0_f32,
23961 param_value_max: 0.0_f32,
23962 param_index: 0_i16,
23963 target_system: 0_u8,
23964 target_component: 0_u8,
23965 param_id: [0_u8; 16usize],
23966 parameter_rc_channel_index: 0_u8,
23967 };
23968 #[cfg(feature = "arbitrary")]
23969 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23970 use arbitrary::{Arbitrary, Unstructured};
23971 let mut buf = [0u8; 1024];
23972 rng.fill_bytes(&mut buf);
23973 let mut unstructured = Unstructured::new(&buf);
23974 Self::arbitrary(&mut unstructured).unwrap_or_default()
23975 }
23976}
23977impl Default for PARAM_MAP_RC_DATA {
23978 fn default() -> Self {
23979 Self::DEFAULT.clone()
23980 }
23981}
23982impl MessageData for PARAM_MAP_RC_DATA {
23983 type Message = MavMessage;
23984 const ID: u32 = 50u32;
23985 const NAME: &'static str = "PARAM_MAP_RC";
23986 const EXTRA_CRC: u8 = 78u8;
23987 const ENCODED_LEN: usize = 37usize;
23988 fn deser(
23989 _version: MavlinkVersion,
23990 __input: &[u8],
23991 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23992 let avail_len = __input.len();
23993 let mut payload_buf = [0; Self::ENCODED_LEN];
23994 let mut buf = if avail_len < Self::ENCODED_LEN {
23995 payload_buf[0..avail_len].copy_from_slice(__input);
23996 Bytes::new(&payload_buf)
23997 } else {
23998 Bytes::new(__input)
23999 };
24000 let mut __struct = Self::default();
24001 __struct.param_value0 = buf.get_f32_le();
24002 __struct.scale = buf.get_f32_le();
24003 __struct.param_value_min = buf.get_f32_le();
24004 __struct.param_value_max = buf.get_f32_le();
24005 __struct.param_index = buf.get_i16_le();
24006 __struct.target_system = buf.get_u8();
24007 __struct.target_component = buf.get_u8();
24008 for v in &mut __struct.param_id {
24009 let val = buf.get_u8();
24010 *v = val;
24011 }
24012 __struct.parameter_rc_channel_index = buf.get_u8();
24013 Ok(__struct)
24014 }
24015 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24016 let mut __tmp = BytesMut::new(bytes);
24017 #[allow(clippy::absurd_extreme_comparisons)]
24018 #[allow(unused_comparisons)]
24019 if __tmp.remaining() < Self::ENCODED_LEN {
24020 panic!(
24021 "buffer is too small (need {} bytes, but got {})",
24022 Self::ENCODED_LEN,
24023 __tmp.remaining(),
24024 )
24025 }
24026 __tmp.put_f32_le(self.param_value0);
24027 __tmp.put_f32_le(self.scale);
24028 __tmp.put_f32_le(self.param_value_min);
24029 __tmp.put_f32_le(self.param_value_max);
24030 __tmp.put_i16_le(self.param_index);
24031 __tmp.put_u8(self.target_system);
24032 __tmp.put_u8(self.target_component);
24033 for val in &self.param_id {
24034 __tmp.put_u8(*val);
24035 }
24036 __tmp.put_u8(self.parameter_rc_channel_index);
24037 if matches!(version, MavlinkVersion::V2) {
24038 let len = __tmp.len();
24039 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24040 } else {
24041 __tmp.len()
24042 }
24043 }
24044}
24045#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24046#[doc = ""]
24047#[doc = "ID: 21"]
24048#[derive(Debug, Clone, PartialEq)]
24049#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24050#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24051#[cfg_attr(feature = "ts", derive(TS))]
24052#[cfg_attr(feature = "ts", ts(export))]
24053pub struct PARAM_REQUEST_LIST_DATA {
24054 #[doc = "System ID"]
24055 pub target_system: u8,
24056 #[doc = "Component ID"]
24057 pub target_component: u8,
24058}
24059impl PARAM_REQUEST_LIST_DATA {
24060 pub const ENCODED_LEN: usize = 2usize;
24061 pub const DEFAULT: Self = Self {
24062 target_system: 0_u8,
24063 target_component: 0_u8,
24064 };
24065 #[cfg(feature = "arbitrary")]
24066 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24067 use arbitrary::{Arbitrary, Unstructured};
24068 let mut buf = [0u8; 1024];
24069 rng.fill_bytes(&mut buf);
24070 let mut unstructured = Unstructured::new(&buf);
24071 Self::arbitrary(&mut unstructured).unwrap_or_default()
24072 }
24073}
24074impl Default for PARAM_REQUEST_LIST_DATA {
24075 fn default() -> Self {
24076 Self::DEFAULT.clone()
24077 }
24078}
24079impl MessageData for PARAM_REQUEST_LIST_DATA {
24080 type Message = MavMessage;
24081 const ID: u32 = 21u32;
24082 const NAME: &'static str = "PARAM_REQUEST_LIST";
24083 const EXTRA_CRC: u8 = 159u8;
24084 const ENCODED_LEN: usize = 2usize;
24085 fn deser(
24086 _version: MavlinkVersion,
24087 __input: &[u8],
24088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24089 let avail_len = __input.len();
24090 let mut payload_buf = [0; Self::ENCODED_LEN];
24091 let mut buf = if avail_len < Self::ENCODED_LEN {
24092 payload_buf[0..avail_len].copy_from_slice(__input);
24093 Bytes::new(&payload_buf)
24094 } else {
24095 Bytes::new(__input)
24096 };
24097 let mut __struct = Self::default();
24098 __struct.target_system = buf.get_u8();
24099 __struct.target_component = buf.get_u8();
24100 Ok(__struct)
24101 }
24102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24103 let mut __tmp = BytesMut::new(bytes);
24104 #[allow(clippy::absurd_extreme_comparisons)]
24105 #[allow(unused_comparisons)]
24106 if __tmp.remaining() < Self::ENCODED_LEN {
24107 panic!(
24108 "buffer is too small (need {} bytes, but got {})",
24109 Self::ENCODED_LEN,
24110 __tmp.remaining(),
24111 )
24112 }
24113 __tmp.put_u8(self.target_system);
24114 __tmp.put_u8(self.target_component);
24115 if matches!(version, MavlinkVersion::V2) {
24116 let len = __tmp.len();
24117 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24118 } else {
24119 __tmp.len()
24120 }
24121 }
24122}
24123#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24124#[doc = ""]
24125#[doc = "ID: 20"]
24126#[derive(Debug, Clone, PartialEq)]
24127#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24128#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24129#[cfg_attr(feature = "ts", derive(TS))]
24130#[cfg_attr(feature = "ts", ts(export))]
24131pub struct PARAM_REQUEST_READ_DATA {
24132 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24133 pub param_index: i16,
24134 #[doc = "System ID"]
24135 pub target_system: u8,
24136 #[doc = "Component ID"]
24137 pub target_component: u8,
24138 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24139 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24140 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24141 pub param_id: [u8; 16],
24142}
24143impl PARAM_REQUEST_READ_DATA {
24144 pub const ENCODED_LEN: usize = 20usize;
24145 pub const DEFAULT: Self = Self {
24146 param_index: 0_i16,
24147 target_system: 0_u8,
24148 target_component: 0_u8,
24149 param_id: [0_u8; 16usize],
24150 };
24151 #[cfg(feature = "arbitrary")]
24152 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24153 use arbitrary::{Arbitrary, Unstructured};
24154 let mut buf = [0u8; 1024];
24155 rng.fill_bytes(&mut buf);
24156 let mut unstructured = Unstructured::new(&buf);
24157 Self::arbitrary(&mut unstructured).unwrap_or_default()
24158 }
24159}
24160impl Default for PARAM_REQUEST_READ_DATA {
24161 fn default() -> Self {
24162 Self::DEFAULT.clone()
24163 }
24164}
24165impl MessageData for PARAM_REQUEST_READ_DATA {
24166 type Message = MavMessage;
24167 const ID: u32 = 20u32;
24168 const NAME: &'static str = "PARAM_REQUEST_READ";
24169 const EXTRA_CRC: u8 = 214u8;
24170 const ENCODED_LEN: usize = 20usize;
24171 fn deser(
24172 _version: MavlinkVersion,
24173 __input: &[u8],
24174 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24175 let avail_len = __input.len();
24176 let mut payload_buf = [0; Self::ENCODED_LEN];
24177 let mut buf = if avail_len < Self::ENCODED_LEN {
24178 payload_buf[0..avail_len].copy_from_slice(__input);
24179 Bytes::new(&payload_buf)
24180 } else {
24181 Bytes::new(__input)
24182 };
24183 let mut __struct = Self::default();
24184 __struct.param_index = buf.get_i16_le();
24185 __struct.target_system = buf.get_u8();
24186 __struct.target_component = buf.get_u8();
24187 for v in &mut __struct.param_id {
24188 let val = buf.get_u8();
24189 *v = val;
24190 }
24191 Ok(__struct)
24192 }
24193 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24194 let mut __tmp = BytesMut::new(bytes);
24195 #[allow(clippy::absurd_extreme_comparisons)]
24196 #[allow(unused_comparisons)]
24197 if __tmp.remaining() < Self::ENCODED_LEN {
24198 panic!(
24199 "buffer is too small (need {} bytes, but got {})",
24200 Self::ENCODED_LEN,
24201 __tmp.remaining(),
24202 )
24203 }
24204 __tmp.put_i16_le(self.param_index);
24205 __tmp.put_u8(self.target_system);
24206 __tmp.put_u8(self.target_component);
24207 for val in &self.param_id {
24208 __tmp.put_u8(*val);
24209 }
24210 if matches!(version, MavlinkVersion::V2) {
24211 let len = __tmp.len();
24212 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24213 } else {
24214 __tmp.len()
24215 }
24216 }
24217}
24218#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24219#[doc = ""]
24220#[doc = "ID: 23"]
24221#[derive(Debug, Clone, PartialEq)]
24222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24224#[cfg_attr(feature = "ts", derive(TS))]
24225#[cfg_attr(feature = "ts", ts(export))]
24226pub struct PARAM_SET_DATA {
24227 #[doc = "Onboard parameter value"]
24228 pub param_value: f32,
24229 #[doc = "System ID"]
24230 pub target_system: u8,
24231 #[doc = "Component ID"]
24232 pub target_component: u8,
24233 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24234 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24235 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24236 pub param_id: [u8; 16],
24237 #[doc = "Onboard parameter type."]
24238 pub param_type: MavParamType,
24239}
24240impl PARAM_SET_DATA {
24241 pub const ENCODED_LEN: usize = 23usize;
24242 pub const DEFAULT: Self = Self {
24243 param_value: 0.0_f32,
24244 target_system: 0_u8,
24245 target_component: 0_u8,
24246 param_id: [0_u8; 16usize],
24247 param_type: MavParamType::DEFAULT,
24248 };
24249 #[cfg(feature = "arbitrary")]
24250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24251 use arbitrary::{Arbitrary, Unstructured};
24252 let mut buf = [0u8; 1024];
24253 rng.fill_bytes(&mut buf);
24254 let mut unstructured = Unstructured::new(&buf);
24255 Self::arbitrary(&mut unstructured).unwrap_or_default()
24256 }
24257}
24258impl Default for PARAM_SET_DATA {
24259 fn default() -> Self {
24260 Self::DEFAULT.clone()
24261 }
24262}
24263impl MessageData for PARAM_SET_DATA {
24264 type Message = MavMessage;
24265 const ID: u32 = 23u32;
24266 const NAME: &'static str = "PARAM_SET";
24267 const EXTRA_CRC: u8 = 168u8;
24268 const ENCODED_LEN: usize = 23usize;
24269 fn deser(
24270 _version: MavlinkVersion,
24271 __input: &[u8],
24272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24273 let avail_len = __input.len();
24274 let mut payload_buf = [0; Self::ENCODED_LEN];
24275 let mut buf = if avail_len < Self::ENCODED_LEN {
24276 payload_buf[0..avail_len].copy_from_slice(__input);
24277 Bytes::new(&payload_buf)
24278 } else {
24279 Bytes::new(__input)
24280 };
24281 let mut __struct = Self::default();
24282 __struct.param_value = buf.get_f32_le();
24283 __struct.target_system = buf.get_u8();
24284 __struct.target_component = buf.get_u8();
24285 for v in &mut __struct.param_id {
24286 let val = buf.get_u8();
24287 *v = val;
24288 }
24289 let tmp = buf.get_u8();
24290 __struct.param_type =
24291 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24292 enum_type: "MavParamType",
24293 value: tmp as u32,
24294 })?;
24295 Ok(__struct)
24296 }
24297 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24298 let mut __tmp = BytesMut::new(bytes);
24299 #[allow(clippy::absurd_extreme_comparisons)]
24300 #[allow(unused_comparisons)]
24301 if __tmp.remaining() < Self::ENCODED_LEN {
24302 panic!(
24303 "buffer is too small (need {} bytes, but got {})",
24304 Self::ENCODED_LEN,
24305 __tmp.remaining(),
24306 )
24307 }
24308 __tmp.put_f32_le(self.param_value);
24309 __tmp.put_u8(self.target_system);
24310 __tmp.put_u8(self.target_component);
24311 for val in &self.param_id {
24312 __tmp.put_u8(*val);
24313 }
24314 __tmp.put_u8(self.param_type as u8);
24315 if matches!(version, MavlinkVersion::V2) {
24316 let len = __tmp.len();
24317 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24318 } else {
24319 __tmp.len()
24320 }
24321 }
24322}
24323#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24324#[doc = ""]
24325#[doc = "ID: 22"]
24326#[derive(Debug, Clone, PartialEq)]
24327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24329#[cfg_attr(feature = "ts", derive(TS))]
24330#[cfg_attr(feature = "ts", ts(export))]
24331pub struct PARAM_VALUE_DATA {
24332 #[doc = "Onboard parameter value"]
24333 pub param_value: f32,
24334 #[doc = "Total number of onboard parameters"]
24335 pub param_count: u16,
24336 #[doc = "Index of this onboard parameter"]
24337 pub param_index: u16,
24338 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24339 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24340 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24341 pub param_id: [u8; 16],
24342 #[doc = "Onboard parameter type."]
24343 pub param_type: MavParamType,
24344}
24345impl PARAM_VALUE_DATA {
24346 pub const ENCODED_LEN: usize = 25usize;
24347 pub const DEFAULT: Self = Self {
24348 param_value: 0.0_f32,
24349 param_count: 0_u16,
24350 param_index: 0_u16,
24351 param_id: [0_u8; 16usize],
24352 param_type: MavParamType::DEFAULT,
24353 };
24354 #[cfg(feature = "arbitrary")]
24355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24356 use arbitrary::{Arbitrary, Unstructured};
24357 let mut buf = [0u8; 1024];
24358 rng.fill_bytes(&mut buf);
24359 let mut unstructured = Unstructured::new(&buf);
24360 Self::arbitrary(&mut unstructured).unwrap_or_default()
24361 }
24362}
24363impl Default for PARAM_VALUE_DATA {
24364 fn default() -> Self {
24365 Self::DEFAULT.clone()
24366 }
24367}
24368impl MessageData for PARAM_VALUE_DATA {
24369 type Message = MavMessage;
24370 const ID: u32 = 22u32;
24371 const NAME: &'static str = "PARAM_VALUE";
24372 const EXTRA_CRC: u8 = 220u8;
24373 const ENCODED_LEN: usize = 25usize;
24374 fn deser(
24375 _version: MavlinkVersion,
24376 __input: &[u8],
24377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24378 let avail_len = __input.len();
24379 let mut payload_buf = [0; Self::ENCODED_LEN];
24380 let mut buf = if avail_len < Self::ENCODED_LEN {
24381 payload_buf[0..avail_len].copy_from_slice(__input);
24382 Bytes::new(&payload_buf)
24383 } else {
24384 Bytes::new(__input)
24385 };
24386 let mut __struct = Self::default();
24387 __struct.param_value = buf.get_f32_le();
24388 __struct.param_count = buf.get_u16_le();
24389 __struct.param_index = buf.get_u16_le();
24390 for v in &mut __struct.param_id {
24391 let val = buf.get_u8();
24392 *v = val;
24393 }
24394 let tmp = buf.get_u8();
24395 __struct.param_type =
24396 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24397 enum_type: "MavParamType",
24398 value: tmp as u32,
24399 })?;
24400 Ok(__struct)
24401 }
24402 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24403 let mut __tmp = BytesMut::new(bytes);
24404 #[allow(clippy::absurd_extreme_comparisons)]
24405 #[allow(unused_comparisons)]
24406 if __tmp.remaining() < Self::ENCODED_LEN {
24407 panic!(
24408 "buffer is too small (need {} bytes, but got {})",
24409 Self::ENCODED_LEN,
24410 __tmp.remaining(),
24411 )
24412 }
24413 __tmp.put_f32_le(self.param_value);
24414 __tmp.put_u16_le(self.param_count);
24415 __tmp.put_u16_le(self.param_index);
24416 for val in &self.param_id {
24417 __tmp.put_u8(*val);
24418 }
24419 __tmp.put_u8(self.param_type as u8);
24420 if matches!(version, MavlinkVersion::V2) {
24421 let len = __tmp.len();
24422 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24423 } else {
24424 __tmp.len()
24425 }
24426 }
24427}
24428#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24429#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24430#[doc = ""]
24431#[doc = "ID: 4"]
24432#[derive(Debug, Clone, PartialEq)]
24433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24435#[cfg_attr(feature = "ts", derive(TS))]
24436#[cfg_attr(feature = "ts", ts(export))]
24437pub struct PING_DATA {
24438 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24439 pub time_usec: u64,
24440 #[doc = "PING sequence"]
24441 pub seq: u32,
24442 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24443 pub target_system: u8,
24444 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24445 pub target_component: u8,
24446}
24447impl PING_DATA {
24448 pub const ENCODED_LEN: usize = 14usize;
24449 pub const DEFAULT: Self = Self {
24450 time_usec: 0_u64,
24451 seq: 0_u32,
24452 target_system: 0_u8,
24453 target_component: 0_u8,
24454 };
24455 #[cfg(feature = "arbitrary")]
24456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24457 use arbitrary::{Arbitrary, Unstructured};
24458 let mut buf = [0u8; 1024];
24459 rng.fill_bytes(&mut buf);
24460 let mut unstructured = Unstructured::new(&buf);
24461 Self::arbitrary(&mut unstructured).unwrap_or_default()
24462 }
24463}
24464impl Default for PING_DATA {
24465 fn default() -> Self {
24466 Self::DEFAULT.clone()
24467 }
24468}
24469impl MessageData for PING_DATA {
24470 type Message = MavMessage;
24471 const ID: u32 = 4u32;
24472 const NAME: &'static str = "PING";
24473 const EXTRA_CRC: u8 = 237u8;
24474 const ENCODED_LEN: usize = 14usize;
24475 fn deser(
24476 _version: MavlinkVersion,
24477 __input: &[u8],
24478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24479 let avail_len = __input.len();
24480 let mut payload_buf = [0; Self::ENCODED_LEN];
24481 let mut buf = if avail_len < Self::ENCODED_LEN {
24482 payload_buf[0..avail_len].copy_from_slice(__input);
24483 Bytes::new(&payload_buf)
24484 } else {
24485 Bytes::new(__input)
24486 };
24487 let mut __struct = Self::default();
24488 __struct.time_usec = buf.get_u64_le();
24489 __struct.seq = buf.get_u32_le();
24490 __struct.target_system = buf.get_u8();
24491 __struct.target_component = buf.get_u8();
24492 Ok(__struct)
24493 }
24494 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24495 let mut __tmp = BytesMut::new(bytes);
24496 #[allow(clippy::absurd_extreme_comparisons)]
24497 #[allow(unused_comparisons)]
24498 if __tmp.remaining() < Self::ENCODED_LEN {
24499 panic!(
24500 "buffer is too small (need {} bytes, but got {})",
24501 Self::ENCODED_LEN,
24502 __tmp.remaining(),
24503 )
24504 }
24505 __tmp.put_u64_le(self.time_usec);
24506 __tmp.put_u32_le(self.seq);
24507 __tmp.put_u8(self.target_system);
24508 __tmp.put_u8(self.target_component);
24509 if matches!(version, MavlinkVersion::V2) {
24510 let len = __tmp.len();
24511 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24512 } else {
24513 __tmp.len()
24514 }
24515 }
24516}
24517#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24518#[doc = "Control vehicle tone generation (buzzer)."]
24519#[doc = ""]
24520#[doc = "ID: 258"]
24521#[derive(Debug, Clone, PartialEq)]
24522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24523#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24524#[cfg_attr(feature = "ts", derive(TS))]
24525#[cfg_attr(feature = "ts", ts(export))]
24526pub struct PLAY_TUNE_DATA {
24527 #[doc = "System ID"]
24528 pub target_system: u8,
24529 #[doc = "Component ID"]
24530 pub target_component: u8,
24531 #[doc = "tune in board specific format"]
24532 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24533 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24534 pub tune: [u8; 30],
24535 #[doc = "tune extension (appended to tune)"]
24536 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24537 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24538 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24539 pub tune2: [u8; 200],
24540}
24541impl PLAY_TUNE_DATA {
24542 pub const ENCODED_LEN: usize = 232usize;
24543 pub const DEFAULT: Self = Self {
24544 target_system: 0_u8,
24545 target_component: 0_u8,
24546 tune: [0_u8; 30usize],
24547 tune2: [0_u8; 200usize],
24548 };
24549 #[cfg(feature = "arbitrary")]
24550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24551 use arbitrary::{Arbitrary, Unstructured};
24552 let mut buf = [0u8; 1024];
24553 rng.fill_bytes(&mut buf);
24554 let mut unstructured = Unstructured::new(&buf);
24555 Self::arbitrary(&mut unstructured).unwrap_or_default()
24556 }
24557}
24558impl Default for PLAY_TUNE_DATA {
24559 fn default() -> Self {
24560 Self::DEFAULT.clone()
24561 }
24562}
24563impl MessageData for PLAY_TUNE_DATA {
24564 type Message = MavMessage;
24565 const ID: u32 = 258u32;
24566 const NAME: &'static str = "PLAY_TUNE";
24567 const EXTRA_CRC: u8 = 187u8;
24568 const ENCODED_LEN: usize = 232usize;
24569 fn deser(
24570 _version: MavlinkVersion,
24571 __input: &[u8],
24572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24573 let avail_len = __input.len();
24574 let mut payload_buf = [0; Self::ENCODED_LEN];
24575 let mut buf = if avail_len < Self::ENCODED_LEN {
24576 payload_buf[0..avail_len].copy_from_slice(__input);
24577 Bytes::new(&payload_buf)
24578 } else {
24579 Bytes::new(__input)
24580 };
24581 let mut __struct = Self::default();
24582 __struct.target_system = buf.get_u8();
24583 __struct.target_component = buf.get_u8();
24584 for v in &mut __struct.tune {
24585 let val = buf.get_u8();
24586 *v = val;
24587 }
24588 for v in &mut __struct.tune2 {
24589 let val = buf.get_u8();
24590 *v = val;
24591 }
24592 Ok(__struct)
24593 }
24594 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24595 let mut __tmp = BytesMut::new(bytes);
24596 #[allow(clippy::absurd_extreme_comparisons)]
24597 #[allow(unused_comparisons)]
24598 if __tmp.remaining() < Self::ENCODED_LEN {
24599 panic!(
24600 "buffer is too small (need {} bytes, but got {})",
24601 Self::ENCODED_LEN,
24602 __tmp.remaining(),
24603 )
24604 }
24605 __tmp.put_u8(self.target_system);
24606 __tmp.put_u8(self.target_component);
24607 for val in &self.tune {
24608 __tmp.put_u8(*val);
24609 }
24610 if matches!(version, MavlinkVersion::V2) {
24611 for val in &self.tune2 {
24612 __tmp.put_u8(*val);
24613 }
24614 let len = __tmp.len();
24615 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24616 } else {
24617 __tmp.len()
24618 }
24619 }
24620}
24621#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24622#[doc = ""]
24623#[doc = "ID: 400"]
24624#[derive(Debug, Clone, PartialEq)]
24625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24626#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24627#[cfg_attr(feature = "ts", derive(TS))]
24628#[cfg_attr(feature = "ts", ts(export))]
24629pub struct PLAY_TUNE_V2_DATA {
24630 #[doc = "Tune format"]
24631 pub format: TuneFormat,
24632 #[doc = "System ID"]
24633 pub target_system: u8,
24634 #[doc = "Component ID"]
24635 pub target_component: u8,
24636 #[doc = "Tune definition as a NULL-terminated string."]
24637 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24638 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24639 pub tune: [u8; 248],
24640}
24641impl PLAY_TUNE_V2_DATA {
24642 pub const ENCODED_LEN: usize = 254usize;
24643 pub const DEFAULT: Self = Self {
24644 format: TuneFormat::DEFAULT,
24645 target_system: 0_u8,
24646 target_component: 0_u8,
24647 tune: [0_u8; 248usize],
24648 };
24649 #[cfg(feature = "arbitrary")]
24650 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24651 use arbitrary::{Arbitrary, Unstructured};
24652 let mut buf = [0u8; 1024];
24653 rng.fill_bytes(&mut buf);
24654 let mut unstructured = Unstructured::new(&buf);
24655 Self::arbitrary(&mut unstructured).unwrap_or_default()
24656 }
24657}
24658impl Default for PLAY_TUNE_V2_DATA {
24659 fn default() -> Self {
24660 Self::DEFAULT.clone()
24661 }
24662}
24663impl MessageData for PLAY_TUNE_V2_DATA {
24664 type Message = MavMessage;
24665 const ID: u32 = 400u32;
24666 const NAME: &'static str = "PLAY_TUNE_V2";
24667 const EXTRA_CRC: u8 = 110u8;
24668 const ENCODED_LEN: usize = 254usize;
24669 fn deser(
24670 _version: MavlinkVersion,
24671 __input: &[u8],
24672 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24673 let avail_len = __input.len();
24674 let mut payload_buf = [0; Self::ENCODED_LEN];
24675 let mut buf = if avail_len < Self::ENCODED_LEN {
24676 payload_buf[0..avail_len].copy_from_slice(__input);
24677 Bytes::new(&payload_buf)
24678 } else {
24679 Bytes::new(__input)
24680 };
24681 let mut __struct = Self::default();
24682 let tmp = buf.get_u32_le();
24683 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24684 ::mavlink_core::error::ParserError::InvalidEnum {
24685 enum_type: "TuneFormat",
24686 value: tmp as u32,
24687 },
24688 )?;
24689 __struct.target_system = buf.get_u8();
24690 __struct.target_component = buf.get_u8();
24691 for v in &mut __struct.tune {
24692 let val = buf.get_u8();
24693 *v = val;
24694 }
24695 Ok(__struct)
24696 }
24697 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24698 let mut __tmp = BytesMut::new(bytes);
24699 #[allow(clippy::absurd_extreme_comparisons)]
24700 #[allow(unused_comparisons)]
24701 if __tmp.remaining() < Self::ENCODED_LEN {
24702 panic!(
24703 "buffer is too small (need {} bytes, but got {})",
24704 Self::ENCODED_LEN,
24705 __tmp.remaining(),
24706 )
24707 }
24708 __tmp.put_u32_le(self.format as u32);
24709 __tmp.put_u8(self.target_system);
24710 __tmp.put_u8(self.target_component);
24711 for val in &self.tune {
24712 __tmp.put_u8(*val);
24713 }
24714 if matches!(version, MavlinkVersion::V2) {
24715 let len = __tmp.len();
24716 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24717 } else {
24718 __tmp.len()
24719 }
24720 }
24721}
24722#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24723#[doc = ""]
24724#[doc = "ID: 87"]
24725#[derive(Debug, Clone, PartialEq)]
24726#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24728#[cfg_attr(feature = "ts", derive(TS))]
24729#[cfg_attr(feature = "ts", ts(export))]
24730pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24731 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24732 pub time_boot_ms: u32,
24733 #[doc = "Latitude in WGS84 frame"]
24734 pub lat_int: i32,
24735 #[doc = "Longitude in WGS84 frame"]
24736 pub lon_int: i32,
24737 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24738 pub alt: f32,
24739 #[doc = "X velocity in NED frame"]
24740 pub vx: f32,
24741 #[doc = "Y velocity in NED frame"]
24742 pub vy: f32,
24743 #[doc = "Z velocity in NED frame"]
24744 pub vz: f32,
24745 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24746 pub afx: f32,
24747 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24748 pub afy: f32,
24749 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24750 pub afz: f32,
24751 #[doc = "yaw setpoint"]
24752 pub yaw: f32,
24753 #[doc = "yaw rate setpoint"]
24754 pub yaw_rate: f32,
24755 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24756 pub type_mask: PositionTargetTypemask,
24757 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24758 pub coordinate_frame: MavFrame,
24759}
24760impl POSITION_TARGET_GLOBAL_INT_DATA {
24761 pub const ENCODED_LEN: usize = 51usize;
24762 pub const DEFAULT: Self = Self {
24763 time_boot_ms: 0_u32,
24764 lat_int: 0_i32,
24765 lon_int: 0_i32,
24766 alt: 0.0_f32,
24767 vx: 0.0_f32,
24768 vy: 0.0_f32,
24769 vz: 0.0_f32,
24770 afx: 0.0_f32,
24771 afy: 0.0_f32,
24772 afz: 0.0_f32,
24773 yaw: 0.0_f32,
24774 yaw_rate: 0.0_f32,
24775 type_mask: PositionTargetTypemask::DEFAULT,
24776 coordinate_frame: MavFrame::DEFAULT,
24777 };
24778 #[cfg(feature = "arbitrary")]
24779 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24780 use arbitrary::{Arbitrary, Unstructured};
24781 let mut buf = [0u8; 1024];
24782 rng.fill_bytes(&mut buf);
24783 let mut unstructured = Unstructured::new(&buf);
24784 Self::arbitrary(&mut unstructured).unwrap_or_default()
24785 }
24786}
24787impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24788 fn default() -> Self {
24789 Self::DEFAULT.clone()
24790 }
24791}
24792impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24793 type Message = MavMessage;
24794 const ID: u32 = 87u32;
24795 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24796 const EXTRA_CRC: u8 = 150u8;
24797 const ENCODED_LEN: usize = 51usize;
24798 fn deser(
24799 _version: MavlinkVersion,
24800 __input: &[u8],
24801 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24802 let avail_len = __input.len();
24803 let mut payload_buf = [0; Self::ENCODED_LEN];
24804 let mut buf = if avail_len < Self::ENCODED_LEN {
24805 payload_buf[0..avail_len].copy_from_slice(__input);
24806 Bytes::new(&payload_buf)
24807 } else {
24808 Bytes::new(__input)
24809 };
24810 let mut __struct = Self::default();
24811 __struct.time_boot_ms = buf.get_u32_le();
24812 __struct.lat_int = buf.get_i32_le();
24813 __struct.lon_int = buf.get_i32_le();
24814 __struct.alt = buf.get_f32_le();
24815 __struct.vx = buf.get_f32_le();
24816 __struct.vy = buf.get_f32_le();
24817 __struct.vz = buf.get_f32_le();
24818 __struct.afx = buf.get_f32_le();
24819 __struct.afy = buf.get_f32_le();
24820 __struct.afz = buf.get_f32_le();
24821 __struct.yaw = buf.get_f32_le();
24822 __struct.yaw_rate = buf.get_f32_le();
24823 let tmp = buf.get_u16_le();
24824 __struct.type_mask = PositionTargetTypemask::from_bits(
24825 tmp & PositionTargetTypemask::all().bits(),
24826 )
24827 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24828 flag_type: "PositionTargetTypemask",
24829 value: tmp as u32,
24830 })?;
24831 let tmp = buf.get_u8();
24832 __struct.coordinate_frame =
24833 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24834 enum_type: "MavFrame",
24835 value: tmp as u32,
24836 })?;
24837 Ok(__struct)
24838 }
24839 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24840 let mut __tmp = BytesMut::new(bytes);
24841 #[allow(clippy::absurd_extreme_comparisons)]
24842 #[allow(unused_comparisons)]
24843 if __tmp.remaining() < Self::ENCODED_LEN {
24844 panic!(
24845 "buffer is too small (need {} bytes, but got {})",
24846 Self::ENCODED_LEN,
24847 __tmp.remaining(),
24848 )
24849 }
24850 __tmp.put_u32_le(self.time_boot_ms);
24851 __tmp.put_i32_le(self.lat_int);
24852 __tmp.put_i32_le(self.lon_int);
24853 __tmp.put_f32_le(self.alt);
24854 __tmp.put_f32_le(self.vx);
24855 __tmp.put_f32_le(self.vy);
24856 __tmp.put_f32_le(self.vz);
24857 __tmp.put_f32_le(self.afx);
24858 __tmp.put_f32_le(self.afy);
24859 __tmp.put_f32_le(self.afz);
24860 __tmp.put_f32_le(self.yaw);
24861 __tmp.put_f32_le(self.yaw_rate);
24862 __tmp.put_u16_le(self.type_mask.bits());
24863 __tmp.put_u8(self.coordinate_frame as u8);
24864 if matches!(version, MavlinkVersion::V2) {
24865 let len = __tmp.len();
24866 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24867 } else {
24868 __tmp.len()
24869 }
24870 }
24871}
24872#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24873#[doc = ""]
24874#[doc = "ID: 85"]
24875#[derive(Debug, Clone, PartialEq)]
24876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24878#[cfg_attr(feature = "ts", derive(TS))]
24879#[cfg_attr(feature = "ts", ts(export))]
24880pub struct POSITION_TARGET_LOCAL_NED_DATA {
24881 #[doc = "Timestamp (time since system boot)."]
24882 pub time_boot_ms: u32,
24883 #[doc = "X Position in NED frame"]
24884 pub x: f32,
24885 #[doc = "Y Position in NED frame"]
24886 pub y: f32,
24887 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24888 pub z: f32,
24889 #[doc = "X velocity in NED frame"]
24890 pub vx: f32,
24891 #[doc = "Y velocity in NED frame"]
24892 pub vy: f32,
24893 #[doc = "Z velocity in NED frame"]
24894 pub vz: f32,
24895 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24896 pub afx: f32,
24897 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24898 pub afy: f32,
24899 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24900 pub afz: f32,
24901 #[doc = "yaw setpoint"]
24902 pub yaw: f32,
24903 #[doc = "yaw rate setpoint"]
24904 pub yaw_rate: f32,
24905 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24906 pub type_mask: PositionTargetTypemask,
24907 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24908 pub coordinate_frame: MavFrame,
24909}
24910impl POSITION_TARGET_LOCAL_NED_DATA {
24911 pub const ENCODED_LEN: usize = 51usize;
24912 pub const DEFAULT: Self = Self {
24913 time_boot_ms: 0_u32,
24914 x: 0.0_f32,
24915 y: 0.0_f32,
24916 z: 0.0_f32,
24917 vx: 0.0_f32,
24918 vy: 0.0_f32,
24919 vz: 0.0_f32,
24920 afx: 0.0_f32,
24921 afy: 0.0_f32,
24922 afz: 0.0_f32,
24923 yaw: 0.0_f32,
24924 yaw_rate: 0.0_f32,
24925 type_mask: PositionTargetTypemask::DEFAULT,
24926 coordinate_frame: MavFrame::DEFAULT,
24927 };
24928 #[cfg(feature = "arbitrary")]
24929 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24930 use arbitrary::{Arbitrary, Unstructured};
24931 let mut buf = [0u8; 1024];
24932 rng.fill_bytes(&mut buf);
24933 let mut unstructured = Unstructured::new(&buf);
24934 Self::arbitrary(&mut unstructured).unwrap_or_default()
24935 }
24936}
24937impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24938 fn default() -> Self {
24939 Self::DEFAULT.clone()
24940 }
24941}
24942impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24943 type Message = MavMessage;
24944 const ID: u32 = 85u32;
24945 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24946 const EXTRA_CRC: u8 = 140u8;
24947 const ENCODED_LEN: usize = 51usize;
24948 fn deser(
24949 _version: MavlinkVersion,
24950 __input: &[u8],
24951 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24952 let avail_len = __input.len();
24953 let mut payload_buf = [0; Self::ENCODED_LEN];
24954 let mut buf = if avail_len < Self::ENCODED_LEN {
24955 payload_buf[0..avail_len].copy_from_slice(__input);
24956 Bytes::new(&payload_buf)
24957 } else {
24958 Bytes::new(__input)
24959 };
24960 let mut __struct = Self::default();
24961 __struct.time_boot_ms = buf.get_u32_le();
24962 __struct.x = buf.get_f32_le();
24963 __struct.y = buf.get_f32_le();
24964 __struct.z = buf.get_f32_le();
24965 __struct.vx = buf.get_f32_le();
24966 __struct.vy = buf.get_f32_le();
24967 __struct.vz = buf.get_f32_le();
24968 __struct.afx = buf.get_f32_le();
24969 __struct.afy = buf.get_f32_le();
24970 __struct.afz = buf.get_f32_le();
24971 __struct.yaw = buf.get_f32_le();
24972 __struct.yaw_rate = buf.get_f32_le();
24973 let tmp = buf.get_u16_le();
24974 __struct.type_mask = PositionTargetTypemask::from_bits(
24975 tmp & PositionTargetTypemask::all().bits(),
24976 )
24977 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24978 flag_type: "PositionTargetTypemask",
24979 value: tmp as u32,
24980 })?;
24981 let tmp = buf.get_u8();
24982 __struct.coordinate_frame =
24983 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24984 enum_type: "MavFrame",
24985 value: tmp as u32,
24986 })?;
24987 Ok(__struct)
24988 }
24989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24990 let mut __tmp = BytesMut::new(bytes);
24991 #[allow(clippy::absurd_extreme_comparisons)]
24992 #[allow(unused_comparisons)]
24993 if __tmp.remaining() < Self::ENCODED_LEN {
24994 panic!(
24995 "buffer is too small (need {} bytes, but got {})",
24996 Self::ENCODED_LEN,
24997 __tmp.remaining(),
24998 )
24999 }
25000 __tmp.put_u32_le(self.time_boot_ms);
25001 __tmp.put_f32_le(self.x);
25002 __tmp.put_f32_le(self.y);
25003 __tmp.put_f32_le(self.z);
25004 __tmp.put_f32_le(self.vx);
25005 __tmp.put_f32_le(self.vy);
25006 __tmp.put_f32_le(self.vz);
25007 __tmp.put_f32_le(self.afx);
25008 __tmp.put_f32_le(self.afy);
25009 __tmp.put_f32_le(self.afz);
25010 __tmp.put_f32_le(self.yaw);
25011 __tmp.put_f32_le(self.yaw_rate);
25012 __tmp.put_u16_le(self.type_mask.bits());
25013 __tmp.put_u8(self.coordinate_frame as u8);
25014 if matches!(version, MavlinkVersion::V2) {
25015 let len = __tmp.len();
25016 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25017 } else {
25018 __tmp.len()
25019 }
25020 }
25021}
25022#[doc = "Power supply status."]
25023#[doc = ""]
25024#[doc = "ID: 125"]
25025#[derive(Debug, Clone, PartialEq)]
25026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25028#[cfg_attr(feature = "ts", derive(TS))]
25029#[cfg_attr(feature = "ts", ts(export))]
25030pub struct POWER_STATUS_DATA {
25031 #[doc = "5V rail voltage."]
25032 pub Vcc: u16,
25033 #[doc = "Servo rail voltage."]
25034 pub Vservo: u16,
25035 #[doc = "Bitmap of power supply status flags."]
25036 pub flags: MavPowerStatus,
25037}
25038impl POWER_STATUS_DATA {
25039 pub const ENCODED_LEN: usize = 6usize;
25040 pub const DEFAULT: Self = Self {
25041 Vcc: 0_u16,
25042 Vservo: 0_u16,
25043 flags: MavPowerStatus::DEFAULT,
25044 };
25045 #[cfg(feature = "arbitrary")]
25046 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25047 use arbitrary::{Arbitrary, Unstructured};
25048 let mut buf = [0u8; 1024];
25049 rng.fill_bytes(&mut buf);
25050 let mut unstructured = Unstructured::new(&buf);
25051 Self::arbitrary(&mut unstructured).unwrap_or_default()
25052 }
25053}
25054impl Default for POWER_STATUS_DATA {
25055 fn default() -> Self {
25056 Self::DEFAULT.clone()
25057 }
25058}
25059impl MessageData for POWER_STATUS_DATA {
25060 type Message = MavMessage;
25061 const ID: u32 = 125u32;
25062 const NAME: &'static str = "POWER_STATUS";
25063 const EXTRA_CRC: u8 = 203u8;
25064 const ENCODED_LEN: usize = 6usize;
25065 fn deser(
25066 _version: MavlinkVersion,
25067 __input: &[u8],
25068 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25069 let avail_len = __input.len();
25070 let mut payload_buf = [0; Self::ENCODED_LEN];
25071 let mut buf = if avail_len < Self::ENCODED_LEN {
25072 payload_buf[0..avail_len].copy_from_slice(__input);
25073 Bytes::new(&payload_buf)
25074 } else {
25075 Bytes::new(__input)
25076 };
25077 let mut __struct = Self::default();
25078 __struct.Vcc = buf.get_u16_le();
25079 __struct.Vservo = buf.get_u16_le();
25080 let tmp = buf.get_u16_le();
25081 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
25082 ::mavlink_core::error::ParserError::InvalidFlag {
25083 flag_type: "MavPowerStatus",
25084 value: tmp as u32,
25085 },
25086 )?;
25087 Ok(__struct)
25088 }
25089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25090 let mut __tmp = BytesMut::new(bytes);
25091 #[allow(clippy::absurd_extreme_comparisons)]
25092 #[allow(unused_comparisons)]
25093 if __tmp.remaining() < Self::ENCODED_LEN {
25094 panic!(
25095 "buffer is too small (need {} bytes, but got {})",
25096 Self::ENCODED_LEN,
25097 __tmp.remaining(),
25098 )
25099 }
25100 __tmp.put_u16_le(self.Vcc);
25101 __tmp.put_u16_le(self.Vservo);
25102 __tmp.put_u16_le(self.flags.bits());
25103 if matches!(version, MavlinkVersion::V2) {
25104 let len = __tmp.len();
25105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25106 } else {
25107 __tmp.len()
25108 }
25109 }
25110}
25111#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25112#[doc = ""]
25113#[doc = "ID: 300"]
25114#[derive(Debug, Clone, PartialEq)]
25115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25117#[cfg_attr(feature = "ts", derive(TS))]
25118#[cfg_attr(feature = "ts", ts(export))]
25119pub struct PROTOCOL_VERSION_DATA {
25120 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25121 pub version: u16,
25122 #[doc = "Minimum MAVLink version supported"]
25123 pub min_version: u16,
25124 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25125 pub max_version: u16,
25126 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25127 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25128 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25129 pub spec_version_hash: [u8; 8],
25130 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25131 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25132 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25133 pub library_version_hash: [u8; 8],
25134}
25135impl PROTOCOL_VERSION_DATA {
25136 pub const ENCODED_LEN: usize = 22usize;
25137 pub const DEFAULT: Self = Self {
25138 version: 0_u16,
25139 min_version: 0_u16,
25140 max_version: 0_u16,
25141 spec_version_hash: [0_u8; 8usize],
25142 library_version_hash: [0_u8; 8usize],
25143 };
25144 #[cfg(feature = "arbitrary")]
25145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25146 use arbitrary::{Arbitrary, Unstructured};
25147 let mut buf = [0u8; 1024];
25148 rng.fill_bytes(&mut buf);
25149 let mut unstructured = Unstructured::new(&buf);
25150 Self::arbitrary(&mut unstructured).unwrap_or_default()
25151 }
25152}
25153impl Default for PROTOCOL_VERSION_DATA {
25154 fn default() -> Self {
25155 Self::DEFAULT.clone()
25156 }
25157}
25158impl MessageData for PROTOCOL_VERSION_DATA {
25159 type Message = MavMessage;
25160 const ID: u32 = 300u32;
25161 const NAME: &'static str = "PROTOCOL_VERSION";
25162 const EXTRA_CRC: u8 = 217u8;
25163 const ENCODED_LEN: usize = 22usize;
25164 fn deser(
25165 _version: MavlinkVersion,
25166 __input: &[u8],
25167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25168 let avail_len = __input.len();
25169 let mut payload_buf = [0; Self::ENCODED_LEN];
25170 let mut buf = if avail_len < Self::ENCODED_LEN {
25171 payload_buf[0..avail_len].copy_from_slice(__input);
25172 Bytes::new(&payload_buf)
25173 } else {
25174 Bytes::new(__input)
25175 };
25176 let mut __struct = Self::default();
25177 __struct.version = buf.get_u16_le();
25178 __struct.min_version = buf.get_u16_le();
25179 __struct.max_version = buf.get_u16_le();
25180 for v in &mut __struct.spec_version_hash {
25181 let val = buf.get_u8();
25182 *v = val;
25183 }
25184 for v in &mut __struct.library_version_hash {
25185 let val = buf.get_u8();
25186 *v = val;
25187 }
25188 Ok(__struct)
25189 }
25190 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25191 let mut __tmp = BytesMut::new(bytes);
25192 #[allow(clippy::absurd_extreme_comparisons)]
25193 #[allow(unused_comparisons)]
25194 if __tmp.remaining() < Self::ENCODED_LEN {
25195 panic!(
25196 "buffer is too small (need {} bytes, but got {})",
25197 Self::ENCODED_LEN,
25198 __tmp.remaining(),
25199 )
25200 }
25201 __tmp.put_u16_le(self.version);
25202 __tmp.put_u16_le(self.min_version);
25203 __tmp.put_u16_le(self.max_version);
25204 for val in &self.spec_version_hash {
25205 __tmp.put_u8(*val);
25206 }
25207 for val in &self.library_version_hash {
25208 __tmp.put_u8(*val);
25209 }
25210 if matches!(version, MavlinkVersion::V2) {
25211 let len = __tmp.len();
25212 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25213 } else {
25214 __tmp.len()
25215 }
25216 }
25217}
25218#[doc = "Status generated by radio and injected into MAVLink stream."]
25219#[doc = ""]
25220#[doc = "ID: 109"]
25221#[derive(Debug, Clone, PartialEq)]
25222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25224#[cfg_attr(feature = "ts", derive(TS))]
25225#[cfg_attr(feature = "ts", ts(export))]
25226pub struct RADIO_STATUS_DATA {
25227 #[doc = "Count of radio packet receive errors (since boot)."]
25228 pub rxerrors: u16,
25229 #[doc = "Count of error corrected radio packets (since boot)."]
25230 pub fixed: u16,
25231 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25232 pub rssi: u8,
25233 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25234 pub remrssi: u8,
25235 #[doc = "Remaining free transmitter buffer space."]
25236 pub txbuf: u8,
25237 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25238 pub noise: u8,
25239 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25240 pub remnoise: u8,
25241}
25242impl RADIO_STATUS_DATA {
25243 pub const ENCODED_LEN: usize = 9usize;
25244 pub const DEFAULT: Self = Self {
25245 rxerrors: 0_u16,
25246 fixed: 0_u16,
25247 rssi: 0_u8,
25248 remrssi: 0_u8,
25249 txbuf: 0_u8,
25250 noise: 0_u8,
25251 remnoise: 0_u8,
25252 };
25253 #[cfg(feature = "arbitrary")]
25254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25255 use arbitrary::{Arbitrary, Unstructured};
25256 let mut buf = [0u8; 1024];
25257 rng.fill_bytes(&mut buf);
25258 let mut unstructured = Unstructured::new(&buf);
25259 Self::arbitrary(&mut unstructured).unwrap_or_default()
25260 }
25261}
25262impl Default for RADIO_STATUS_DATA {
25263 fn default() -> Self {
25264 Self::DEFAULT.clone()
25265 }
25266}
25267impl MessageData for RADIO_STATUS_DATA {
25268 type Message = MavMessage;
25269 const ID: u32 = 109u32;
25270 const NAME: &'static str = "RADIO_STATUS";
25271 const EXTRA_CRC: u8 = 185u8;
25272 const ENCODED_LEN: usize = 9usize;
25273 fn deser(
25274 _version: MavlinkVersion,
25275 __input: &[u8],
25276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25277 let avail_len = __input.len();
25278 let mut payload_buf = [0; Self::ENCODED_LEN];
25279 let mut buf = if avail_len < Self::ENCODED_LEN {
25280 payload_buf[0..avail_len].copy_from_slice(__input);
25281 Bytes::new(&payload_buf)
25282 } else {
25283 Bytes::new(__input)
25284 };
25285 let mut __struct = Self::default();
25286 __struct.rxerrors = buf.get_u16_le();
25287 __struct.fixed = buf.get_u16_le();
25288 __struct.rssi = buf.get_u8();
25289 __struct.remrssi = buf.get_u8();
25290 __struct.txbuf = buf.get_u8();
25291 __struct.noise = buf.get_u8();
25292 __struct.remnoise = buf.get_u8();
25293 Ok(__struct)
25294 }
25295 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25296 let mut __tmp = BytesMut::new(bytes);
25297 #[allow(clippy::absurd_extreme_comparisons)]
25298 #[allow(unused_comparisons)]
25299 if __tmp.remaining() < Self::ENCODED_LEN {
25300 panic!(
25301 "buffer is too small (need {} bytes, but got {})",
25302 Self::ENCODED_LEN,
25303 __tmp.remaining(),
25304 )
25305 }
25306 __tmp.put_u16_le(self.rxerrors);
25307 __tmp.put_u16_le(self.fixed);
25308 __tmp.put_u8(self.rssi);
25309 __tmp.put_u8(self.remrssi);
25310 __tmp.put_u8(self.txbuf);
25311 __tmp.put_u8(self.noise);
25312 __tmp.put_u8(self.remnoise);
25313 if matches!(version, MavlinkVersion::V2) {
25314 let len = __tmp.len();
25315 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25316 } else {
25317 __tmp.len()
25318 }
25319 }
25320}
25321#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25322#[doc = ""]
25323#[doc = "ID: 27"]
25324#[derive(Debug, Clone, PartialEq)]
25325#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25326#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25327#[cfg_attr(feature = "ts", derive(TS))]
25328#[cfg_attr(feature = "ts", ts(export))]
25329pub struct RAW_IMU_DATA {
25330 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25331 pub time_usec: u64,
25332 #[doc = "X acceleration (raw)"]
25333 pub xacc: i16,
25334 #[doc = "Y acceleration (raw)"]
25335 pub yacc: i16,
25336 #[doc = "Z acceleration (raw)"]
25337 pub zacc: i16,
25338 #[doc = "Angular speed around X axis (raw)"]
25339 pub xgyro: i16,
25340 #[doc = "Angular speed around Y axis (raw)"]
25341 pub ygyro: i16,
25342 #[doc = "Angular speed around Z axis (raw)"]
25343 pub zgyro: i16,
25344 #[doc = "X Magnetic field (raw)"]
25345 pub xmag: i16,
25346 #[doc = "Y Magnetic field (raw)"]
25347 pub ymag: i16,
25348 #[doc = "Z Magnetic field (raw)"]
25349 pub zmag: i16,
25350 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25351 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25352 pub id: u8,
25353 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25354 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25355 pub temperature: i16,
25356}
25357impl RAW_IMU_DATA {
25358 pub const ENCODED_LEN: usize = 29usize;
25359 pub const DEFAULT: Self = Self {
25360 time_usec: 0_u64,
25361 xacc: 0_i16,
25362 yacc: 0_i16,
25363 zacc: 0_i16,
25364 xgyro: 0_i16,
25365 ygyro: 0_i16,
25366 zgyro: 0_i16,
25367 xmag: 0_i16,
25368 ymag: 0_i16,
25369 zmag: 0_i16,
25370 id: 0_u8,
25371 temperature: 0_i16,
25372 };
25373 #[cfg(feature = "arbitrary")]
25374 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25375 use arbitrary::{Arbitrary, Unstructured};
25376 let mut buf = [0u8; 1024];
25377 rng.fill_bytes(&mut buf);
25378 let mut unstructured = Unstructured::new(&buf);
25379 Self::arbitrary(&mut unstructured).unwrap_or_default()
25380 }
25381}
25382impl Default for RAW_IMU_DATA {
25383 fn default() -> Self {
25384 Self::DEFAULT.clone()
25385 }
25386}
25387impl MessageData for RAW_IMU_DATA {
25388 type Message = MavMessage;
25389 const ID: u32 = 27u32;
25390 const NAME: &'static str = "RAW_IMU";
25391 const EXTRA_CRC: u8 = 144u8;
25392 const ENCODED_LEN: usize = 29usize;
25393 fn deser(
25394 _version: MavlinkVersion,
25395 __input: &[u8],
25396 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25397 let avail_len = __input.len();
25398 let mut payload_buf = [0; Self::ENCODED_LEN];
25399 let mut buf = if avail_len < Self::ENCODED_LEN {
25400 payload_buf[0..avail_len].copy_from_slice(__input);
25401 Bytes::new(&payload_buf)
25402 } else {
25403 Bytes::new(__input)
25404 };
25405 let mut __struct = Self::default();
25406 __struct.time_usec = buf.get_u64_le();
25407 __struct.xacc = buf.get_i16_le();
25408 __struct.yacc = buf.get_i16_le();
25409 __struct.zacc = buf.get_i16_le();
25410 __struct.xgyro = buf.get_i16_le();
25411 __struct.ygyro = buf.get_i16_le();
25412 __struct.zgyro = buf.get_i16_le();
25413 __struct.xmag = buf.get_i16_le();
25414 __struct.ymag = buf.get_i16_le();
25415 __struct.zmag = buf.get_i16_le();
25416 __struct.id = buf.get_u8();
25417 __struct.temperature = buf.get_i16_le();
25418 Ok(__struct)
25419 }
25420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25421 let mut __tmp = BytesMut::new(bytes);
25422 #[allow(clippy::absurd_extreme_comparisons)]
25423 #[allow(unused_comparisons)]
25424 if __tmp.remaining() < Self::ENCODED_LEN {
25425 panic!(
25426 "buffer is too small (need {} bytes, but got {})",
25427 Self::ENCODED_LEN,
25428 __tmp.remaining(),
25429 )
25430 }
25431 __tmp.put_u64_le(self.time_usec);
25432 __tmp.put_i16_le(self.xacc);
25433 __tmp.put_i16_le(self.yacc);
25434 __tmp.put_i16_le(self.zacc);
25435 __tmp.put_i16_le(self.xgyro);
25436 __tmp.put_i16_le(self.ygyro);
25437 __tmp.put_i16_le(self.zgyro);
25438 __tmp.put_i16_le(self.xmag);
25439 __tmp.put_i16_le(self.ymag);
25440 __tmp.put_i16_le(self.zmag);
25441 if matches!(version, MavlinkVersion::V2) {
25442 __tmp.put_u8(self.id);
25443 __tmp.put_i16_le(self.temperature);
25444 let len = __tmp.len();
25445 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25446 } else {
25447 __tmp.len()
25448 }
25449 }
25450}
25451#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25452#[doc = ""]
25453#[doc = "ID: 28"]
25454#[derive(Debug, Clone, PartialEq)]
25455#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25456#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25457#[cfg_attr(feature = "ts", derive(TS))]
25458#[cfg_attr(feature = "ts", ts(export))]
25459pub struct RAW_PRESSURE_DATA {
25460 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25461 pub time_usec: u64,
25462 #[doc = "Absolute pressure (raw)"]
25463 pub press_abs: i16,
25464 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25465 pub press_diff1: i16,
25466 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25467 pub press_diff2: i16,
25468 #[doc = "Raw Temperature measurement (raw)"]
25469 pub temperature: i16,
25470}
25471impl RAW_PRESSURE_DATA {
25472 pub const ENCODED_LEN: usize = 16usize;
25473 pub const DEFAULT: Self = Self {
25474 time_usec: 0_u64,
25475 press_abs: 0_i16,
25476 press_diff1: 0_i16,
25477 press_diff2: 0_i16,
25478 temperature: 0_i16,
25479 };
25480 #[cfg(feature = "arbitrary")]
25481 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25482 use arbitrary::{Arbitrary, Unstructured};
25483 let mut buf = [0u8; 1024];
25484 rng.fill_bytes(&mut buf);
25485 let mut unstructured = Unstructured::new(&buf);
25486 Self::arbitrary(&mut unstructured).unwrap_or_default()
25487 }
25488}
25489impl Default for RAW_PRESSURE_DATA {
25490 fn default() -> Self {
25491 Self::DEFAULT.clone()
25492 }
25493}
25494impl MessageData for RAW_PRESSURE_DATA {
25495 type Message = MavMessage;
25496 const ID: u32 = 28u32;
25497 const NAME: &'static str = "RAW_PRESSURE";
25498 const EXTRA_CRC: u8 = 67u8;
25499 const ENCODED_LEN: usize = 16usize;
25500 fn deser(
25501 _version: MavlinkVersion,
25502 __input: &[u8],
25503 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25504 let avail_len = __input.len();
25505 let mut payload_buf = [0; Self::ENCODED_LEN];
25506 let mut buf = if avail_len < Self::ENCODED_LEN {
25507 payload_buf[0..avail_len].copy_from_slice(__input);
25508 Bytes::new(&payload_buf)
25509 } else {
25510 Bytes::new(__input)
25511 };
25512 let mut __struct = Self::default();
25513 __struct.time_usec = buf.get_u64_le();
25514 __struct.press_abs = buf.get_i16_le();
25515 __struct.press_diff1 = buf.get_i16_le();
25516 __struct.press_diff2 = buf.get_i16_le();
25517 __struct.temperature = buf.get_i16_le();
25518 Ok(__struct)
25519 }
25520 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25521 let mut __tmp = BytesMut::new(bytes);
25522 #[allow(clippy::absurd_extreme_comparisons)]
25523 #[allow(unused_comparisons)]
25524 if __tmp.remaining() < Self::ENCODED_LEN {
25525 panic!(
25526 "buffer is too small (need {} bytes, but got {})",
25527 Self::ENCODED_LEN,
25528 __tmp.remaining(),
25529 )
25530 }
25531 __tmp.put_u64_le(self.time_usec);
25532 __tmp.put_i16_le(self.press_abs);
25533 __tmp.put_i16_le(self.press_diff1);
25534 __tmp.put_i16_le(self.press_diff2);
25535 __tmp.put_i16_le(self.temperature);
25536 if matches!(version, MavlinkVersion::V2) {
25537 let len = __tmp.len();
25538 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25539 } else {
25540 __tmp.len()
25541 }
25542 }
25543}
25544#[doc = "RPM sensor data message."]
25545#[doc = ""]
25546#[doc = "ID: 339"]
25547#[derive(Debug, Clone, PartialEq)]
25548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25549#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25550#[cfg_attr(feature = "ts", derive(TS))]
25551#[cfg_attr(feature = "ts", ts(export))]
25552pub struct RAW_RPM_DATA {
25553 #[doc = "Indicated rate"]
25554 pub frequency: f32,
25555 #[doc = "Index of this RPM sensor (0-indexed)"]
25556 pub index: u8,
25557}
25558impl RAW_RPM_DATA {
25559 pub const ENCODED_LEN: usize = 5usize;
25560 pub const DEFAULT: Self = Self {
25561 frequency: 0.0_f32,
25562 index: 0_u8,
25563 };
25564 #[cfg(feature = "arbitrary")]
25565 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25566 use arbitrary::{Arbitrary, Unstructured};
25567 let mut buf = [0u8; 1024];
25568 rng.fill_bytes(&mut buf);
25569 let mut unstructured = Unstructured::new(&buf);
25570 Self::arbitrary(&mut unstructured).unwrap_or_default()
25571 }
25572}
25573impl Default for RAW_RPM_DATA {
25574 fn default() -> Self {
25575 Self::DEFAULT.clone()
25576 }
25577}
25578impl MessageData for RAW_RPM_DATA {
25579 type Message = MavMessage;
25580 const ID: u32 = 339u32;
25581 const NAME: &'static str = "RAW_RPM";
25582 const EXTRA_CRC: u8 = 199u8;
25583 const ENCODED_LEN: usize = 5usize;
25584 fn deser(
25585 _version: MavlinkVersion,
25586 __input: &[u8],
25587 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25588 let avail_len = __input.len();
25589 let mut payload_buf = [0; Self::ENCODED_LEN];
25590 let mut buf = if avail_len < Self::ENCODED_LEN {
25591 payload_buf[0..avail_len].copy_from_slice(__input);
25592 Bytes::new(&payload_buf)
25593 } else {
25594 Bytes::new(__input)
25595 };
25596 let mut __struct = Self::default();
25597 __struct.frequency = buf.get_f32_le();
25598 __struct.index = buf.get_u8();
25599 Ok(__struct)
25600 }
25601 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25602 let mut __tmp = BytesMut::new(bytes);
25603 #[allow(clippy::absurd_extreme_comparisons)]
25604 #[allow(unused_comparisons)]
25605 if __tmp.remaining() < Self::ENCODED_LEN {
25606 panic!(
25607 "buffer is too small (need {} bytes, but got {})",
25608 Self::ENCODED_LEN,
25609 __tmp.remaining(),
25610 )
25611 }
25612 __tmp.put_f32_le(self.frequency);
25613 __tmp.put_u8(self.index);
25614 if matches!(version, MavlinkVersion::V2) {
25615 let len = __tmp.len();
25616 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25617 } else {
25618 __tmp.len()
25619 }
25620 }
25621}
25622#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25623#[doc = ""]
25624#[doc = "ID: 65"]
25625#[derive(Debug, Clone, PartialEq)]
25626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25628#[cfg_attr(feature = "ts", derive(TS))]
25629#[cfg_attr(feature = "ts", ts(export))]
25630pub struct RC_CHANNELS_DATA {
25631 #[doc = "Timestamp (time since system boot)."]
25632 pub time_boot_ms: u32,
25633 #[doc = "RC channel 1 value."]
25634 pub chan1_raw: u16,
25635 #[doc = "RC channel 2 value."]
25636 pub chan2_raw: u16,
25637 #[doc = "RC channel 3 value."]
25638 pub chan3_raw: u16,
25639 #[doc = "RC channel 4 value."]
25640 pub chan4_raw: u16,
25641 #[doc = "RC channel 5 value."]
25642 pub chan5_raw: u16,
25643 #[doc = "RC channel 6 value."]
25644 pub chan6_raw: u16,
25645 #[doc = "RC channel 7 value."]
25646 pub chan7_raw: u16,
25647 #[doc = "RC channel 8 value."]
25648 pub chan8_raw: u16,
25649 #[doc = "RC channel 9 value."]
25650 pub chan9_raw: u16,
25651 #[doc = "RC channel 10 value."]
25652 pub chan10_raw: u16,
25653 #[doc = "RC channel 11 value."]
25654 pub chan11_raw: u16,
25655 #[doc = "RC channel 12 value."]
25656 pub chan12_raw: u16,
25657 #[doc = "RC channel 13 value."]
25658 pub chan13_raw: u16,
25659 #[doc = "RC channel 14 value."]
25660 pub chan14_raw: u16,
25661 #[doc = "RC channel 15 value."]
25662 pub chan15_raw: u16,
25663 #[doc = "RC channel 16 value."]
25664 pub chan16_raw: u16,
25665 #[doc = "RC channel 17 value."]
25666 pub chan17_raw: u16,
25667 #[doc = "RC channel 18 value."]
25668 pub chan18_raw: u16,
25669 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25670 pub chancount: u8,
25671 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25672 pub rssi: u8,
25673}
25674impl RC_CHANNELS_DATA {
25675 pub const ENCODED_LEN: usize = 42usize;
25676 pub const DEFAULT: Self = Self {
25677 time_boot_ms: 0_u32,
25678 chan1_raw: 0_u16,
25679 chan2_raw: 0_u16,
25680 chan3_raw: 0_u16,
25681 chan4_raw: 0_u16,
25682 chan5_raw: 0_u16,
25683 chan6_raw: 0_u16,
25684 chan7_raw: 0_u16,
25685 chan8_raw: 0_u16,
25686 chan9_raw: 0_u16,
25687 chan10_raw: 0_u16,
25688 chan11_raw: 0_u16,
25689 chan12_raw: 0_u16,
25690 chan13_raw: 0_u16,
25691 chan14_raw: 0_u16,
25692 chan15_raw: 0_u16,
25693 chan16_raw: 0_u16,
25694 chan17_raw: 0_u16,
25695 chan18_raw: 0_u16,
25696 chancount: 0_u8,
25697 rssi: 0_u8,
25698 };
25699 #[cfg(feature = "arbitrary")]
25700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25701 use arbitrary::{Arbitrary, Unstructured};
25702 let mut buf = [0u8; 1024];
25703 rng.fill_bytes(&mut buf);
25704 let mut unstructured = Unstructured::new(&buf);
25705 Self::arbitrary(&mut unstructured).unwrap_or_default()
25706 }
25707}
25708impl Default for RC_CHANNELS_DATA {
25709 fn default() -> Self {
25710 Self::DEFAULT.clone()
25711 }
25712}
25713impl MessageData for RC_CHANNELS_DATA {
25714 type Message = MavMessage;
25715 const ID: u32 = 65u32;
25716 const NAME: &'static str = "RC_CHANNELS";
25717 const EXTRA_CRC: u8 = 118u8;
25718 const ENCODED_LEN: usize = 42usize;
25719 fn deser(
25720 _version: MavlinkVersion,
25721 __input: &[u8],
25722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25723 let avail_len = __input.len();
25724 let mut payload_buf = [0; Self::ENCODED_LEN];
25725 let mut buf = if avail_len < Self::ENCODED_LEN {
25726 payload_buf[0..avail_len].copy_from_slice(__input);
25727 Bytes::new(&payload_buf)
25728 } else {
25729 Bytes::new(__input)
25730 };
25731 let mut __struct = Self::default();
25732 __struct.time_boot_ms = buf.get_u32_le();
25733 __struct.chan1_raw = buf.get_u16_le();
25734 __struct.chan2_raw = buf.get_u16_le();
25735 __struct.chan3_raw = buf.get_u16_le();
25736 __struct.chan4_raw = buf.get_u16_le();
25737 __struct.chan5_raw = buf.get_u16_le();
25738 __struct.chan6_raw = buf.get_u16_le();
25739 __struct.chan7_raw = buf.get_u16_le();
25740 __struct.chan8_raw = buf.get_u16_le();
25741 __struct.chan9_raw = buf.get_u16_le();
25742 __struct.chan10_raw = buf.get_u16_le();
25743 __struct.chan11_raw = buf.get_u16_le();
25744 __struct.chan12_raw = buf.get_u16_le();
25745 __struct.chan13_raw = buf.get_u16_le();
25746 __struct.chan14_raw = buf.get_u16_le();
25747 __struct.chan15_raw = buf.get_u16_le();
25748 __struct.chan16_raw = buf.get_u16_le();
25749 __struct.chan17_raw = buf.get_u16_le();
25750 __struct.chan18_raw = buf.get_u16_le();
25751 __struct.chancount = buf.get_u8();
25752 __struct.rssi = buf.get_u8();
25753 Ok(__struct)
25754 }
25755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25756 let mut __tmp = BytesMut::new(bytes);
25757 #[allow(clippy::absurd_extreme_comparisons)]
25758 #[allow(unused_comparisons)]
25759 if __tmp.remaining() < Self::ENCODED_LEN {
25760 panic!(
25761 "buffer is too small (need {} bytes, but got {})",
25762 Self::ENCODED_LEN,
25763 __tmp.remaining(),
25764 )
25765 }
25766 __tmp.put_u32_le(self.time_boot_ms);
25767 __tmp.put_u16_le(self.chan1_raw);
25768 __tmp.put_u16_le(self.chan2_raw);
25769 __tmp.put_u16_le(self.chan3_raw);
25770 __tmp.put_u16_le(self.chan4_raw);
25771 __tmp.put_u16_le(self.chan5_raw);
25772 __tmp.put_u16_le(self.chan6_raw);
25773 __tmp.put_u16_le(self.chan7_raw);
25774 __tmp.put_u16_le(self.chan8_raw);
25775 __tmp.put_u16_le(self.chan9_raw);
25776 __tmp.put_u16_le(self.chan10_raw);
25777 __tmp.put_u16_le(self.chan11_raw);
25778 __tmp.put_u16_le(self.chan12_raw);
25779 __tmp.put_u16_le(self.chan13_raw);
25780 __tmp.put_u16_le(self.chan14_raw);
25781 __tmp.put_u16_le(self.chan15_raw);
25782 __tmp.put_u16_le(self.chan16_raw);
25783 __tmp.put_u16_le(self.chan17_raw);
25784 __tmp.put_u16_le(self.chan18_raw);
25785 __tmp.put_u8(self.chancount);
25786 __tmp.put_u8(self.rssi);
25787 if matches!(version, MavlinkVersion::V2) {
25788 let len = __tmp.len();
25789 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25790 } else {
25791 __tmp.len()
25792 }
25793 }
25794}
25795#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25796#[doc = ""]
25797#[doc = "ID: 70"]
25798#[derive(Debug, Clone, PartialEq)]
25799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25801#[cfg_attr(feature = "ts", derive(TS))]
25802#[cfg_attr(feature = "ts", ts(export))]
25803pub struct RC_CHANNELS_OVERRIDE_DATA {
25804 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25805 pub chan1_raw: u16,
25806 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25807 pub chan2_raw: u16,
25808 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25809 pub chan3_raw: u16,
25810 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25811 pub chan4_raw: u16,
25812 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25813 pub chan5_raw: u16,
25814 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25815 pub chan6_raw: u16,
25816 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25817 pub chan7_raw: u16,
25818 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25819 pub chan8_raw: u16,
25820 #[doc = "System ID"]
25821 pub target_system: u8,
25822 #[doc = "Component ID"]
25823 pub target_component: u8,
25824 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25825 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25826 pub chan9_raw: u16,
25827 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25829 pub chan10_raw: u16,
25830 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25831 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25832 pub chan11_raw: u16,
25833 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25834 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25835 pub chan12_raw: u16,
25836 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25837 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25838 pub chan13_raw: u16,
25839 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25840 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25841 pub chan14_raw: u16,
25842 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25843 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25844 pub chan15_raw: u16,
25845 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25846 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25847 pub chan16_raw: u16,
25848 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25849 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25850 pub chan17_raw: u16,
25851 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25852 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25853 pub chan18_raw: u16,
25854}
25855impl RC_CHANNELS_OVERRIDE_DATA {
25856 pub const ENCODED_LEN: usize = 38usize;
25857 pub const DEFAULT: Self = Self {
25858 chan1_raw: 0_u16,
25859 chan2_raw: 0_u16,
25860 chan3_raw: 0_u16,
25861 chan4_raw: 0_u16,
25862 chan5_raw: 0_u16,
25863 chan6_raw: 0_u16,
25864 chan7_raw: 0_u16,
25865 chan8_raw: 0_u16,
25866 target_system: 0_u8,
25867 target_component: 0_u8,
25868 chan9_raw: 0_u16,
25869 chan10_raw: 0_u16,
25870 chan11_raw: 0_u16,
25871 chan12_raw: 0_u16,
25872 chan13_raw: 0_u16,
25873 chan14_raw: 0_u16,
25874 chan15_raw: 0_u16,
25875 chan16_raw: 0_u16,
25876 chan17_raw: 0_u16,
25877 chan18_raw: 0_u16,
25878 };
25879 #[cfg(feature = "arbitrary")]
25880 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25881 use arbitrary::{Arbitrary, Unstructured};
25882 let mut buf = [0u8; 1024];
25883 rng.fill_bytes(&mut buf);
25884 let mut unstructured = Unstructured::new(&buf);
25885 Self::arbitrary(&mut unstructured).unwrap_or_default()
25886 }
25887}
25888impl Default for RC_CHANNELS_OVERRIDE_DATA {
25889 fn default() -> Self {
25890 Self::DEFAULT.clone()
25891 }
25892}
25893impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25894 type Message = MavMessage;
25895 const ID: u32 = 70u32;
25896 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25897 const EXTRA_CRC: u8 = 124u8;
25898 const ENCODED_LEN: usize = 38usize;
25899 fn deser(
25900 _version: MavlinkVersion,
25901 __input: &[u8],
25902 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25903 let avail_len = __input.len();
25904 let mut payload_buf = [0; Self::ENCODED_LEN];
25905 let mut buf = if avail_len < Self::ENCODED_LEN {
25906 payload_buf[0..avail_len].copy_from_slice(__input);
25907 Bytes::new(&payload_buf)
25908 } else {
25909 Bytes::new(__input)
25910 };
25911 let mut __struct = Self::default();
25912 __struct.chan1_raw = buf.get_u16_le();
25913 __struct.chan2_raw = buf.get_u16_le();
25914 __struct.chan3_raw = buf.get_u16_le();
25915 __struct.chan4_raw = buf.get_u16_le();
25916 __struct.chan5_raw = buf.get_u16_le();
25917 __struct.chan6_raw = buf.get_u16_le();
25918 __struct.chan7_raw = buf.get_u16_le();
25919 __struct.chan8_raw = buf.get_u16_le();
25920 __struct.target_system = buf.get_u8();
25921 __struct.target_component = buf.get_u8();
25922 __struct.chan9_raw = buf.get_u16_le();
25923 __struct.chan10_raw = buf.get_u16_le();
25924 __struct.chan11_raw = buf.get_u16_le();
25925 __struct.chan12_raw = buf.get_u16_le();
25926 __struct.chan13_raw = buf.get_u16_le();
25927 __struct.chan14_raw = buf.get_u16_le();
25928 __struct.chan15_raw = buf.get_u16_le();
25929 __struct.chan16_raw = buf.get_u16_le();
25930 __struct.chan17_raw = buf.get_u16_le();
25931 __struct.chan18_raw = buf.get_u16_le();
25932 Ok(__struct)
25933 }
25934 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25935 let mut __tmp = BytesMut::new(bytes);
25936 #[allow(clippy::absurd_extreme_comparisons)]
25937 #[allow(unused_comparisons)]
25938 if __tmp.remaining() < Self::ENCODED_LEN {
25939 panic!(
25940 "buffer is too small (need {} bytes, but got {})",
25941 Self::ENCODED_LEN,
25942 __tmp.remaining(),
25943 )
25944 }
25945 __tmp.put_u16_le(self.chan1_raw);
25946 __tmp.put_u16_le(self.chan2_raw);
25947 __tmp.put_u16_le(self.chan3_raw);
25948 __tmp.put_u16_le(self.chan4_raw);
25949 __tmp.put_u16_le(self.chan5_raw);
25950 __tmp.put_u16_le(self.chan6_raw);
25951 __tmp.put_u16_le(self.chan7_raw);
25952 __tmp.put_u16_le(self.chan8_raw);
25953 __tmp.put_u8(self.target_system);
25954 __tmp.put_u8(self.target_component);
25955 if matches!(version, MavlinkVersion::V2) {
25956 __tmp.put_u16_le(self.chan9_raw);
25957 __tmp.put_u16_le(self.chan10_raw);
25958 __tmp.put_u16_le(self.chan11_raw);
25959 __tmp.put_u16_le(self.chan12_raw);
25960 __tmp.put_u16_le(self.chan13_raw);
25961 __tmp.put_u16_le(self.chan14_raw);
25962 __tmp.put_u16_le(self.chan15_raw);
25963 __tmp.put_u16_le(self.chan16_raw);
25964 __tmp.put_u16_le(self.chan17_raw);
25965 __tmp.put_u16_le(self.chan18_raw);
25966 let len = __tmp.len();
25967 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25968 } else {
25969 __tmp.len()
25970 }
25971 }
25972}
25973#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25974#[doc = ""]
25975#[doc = "ID: 35"]
25976#[derive(Debug, Clone, PartialEq)]
25977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25979#[cfg_attr(feature = "ts", derive(TS))]
25980#[cfg_attr(feature = "ts", ts(export))]
25981pub struct RC_CHANNELS_RAW_DATA {
25982 #[doc = "Timestamp (time since system boot)."]
25983 pub time_boot_ms: u32,
25984 #[doc = "RC channel 1 value."]
25985 pub chan1_raw: u16,
25986 #[doc = "RC channel 2 value."]
25987 pub chan2_raw: u16,
25988 #[doc = "RC channel 3 value."]
25989 pub chan3_raw: u16,
25990 #[doc = "RC channel 4 value."]
25991 pub chan4_raw: u16,
25992 #[doc = "RC channel 5 value."]
25993 pub chan5_raw: u16,
25994 #[doc = "RC channel 6 value."]
25995 pub chan6_raw: u16,
25996 #[doc = "RC channel 7 value."]
25997 pub chan7_raw: u16,
25998 #[doc = "RC channel 8 value."]
25999 pub chan8_raw: u16,
26000 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26001 pub port: u8,
26002 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26003 pub rssi: u8,
26004}
26005impl RC_CHANNELS_RAW_DATA {
26006 pub const ENCODED_LEN: usize = 22usize;
26007 pub const DEFAULT: Self = Self {
26008 time_boot_ms: 0_u32,
26009 chan1_raw: 0_u16,
26010 chan2_raw: 0_u16,
26011 chan3_raw: 0_u16,
26012 chan4_raw: 0_u16,
26013 chan5_raw: 0_u16,
26014 chan6_raw: 0_u16,
26015 chan7_raw: 0_u16,
26016 chan8_raw: 0_u16,
26017 port: 0_u8,
26018 rssi: 0_u8,
26019 };
26020 #[cfg(feature = "arbitrary")]
26021 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26022 use arbitrary::{Arbitrary, Unstructured};
26023 let mut buf = [0u8; 1024];
26024 rng.fill_bytes(&mut buf);
26025 let mut unstructured = Unstructured::new(&buf);
26026 Self::arbitrary(&mut unstructured).unwrap_or_default()
26027 }
26028}
26029impl Default for RC_CHANNELS_RAW_DATA {
26030 fn default() -> Self {
26031 Self::DEFAULT.clone()
26032 }
26033}
26034impl MessageData for RC_CHANNELS_RAW_DATA {
26035 type Message = MavMessage;
26036 const ID: u32 = 35u32;
26037 const NAME: &'static str = "RC_CHANNELS_RAW";
26038 const EXTRA_CRC: u8 = 244u8;
26039 const ENCODED_LEN: usize = 22usize;
26040 fn deser(
26041 _version: MavlinkVersion,
26042 __input: &[u8],
26043 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26044 let avail_len = __input.len();
26045 let mut payload_buf = [0; Self::ENCODED_LEN];
26046 let mut buf = if avail_len < Self::ENCODED_LEN {
26047 payload_buf[0..avail_len].copy_from_slice(__input);
26048 Bytes::new(&payload_buf)
26049 } else {
26050 Bytes::new(__input)
26051 };
26052 let mut __struct = Self::default();
26053 __struct.time_boot_ms = buf.get_u32_le();
26054 __struct.chan1_raw = buf.get_u16_le();
26055 __struct.chan2_raw = buf.get_u16_le();
26056 __struct.chan3_raw = buf.get_u16_le();
26057 __struct.chan4_raw = buf.get_u16_le();
26058 __struct.chan5_raw = buf.get_u16_le();
26059 __struct.chan6_raw = buf.get_u16_le();
26060 __struct.chan7_raw = buf.get_u16_le();
26061 __struct.chan8_raw = buf.get_u16_le();
26062 __struct.port = buf.get_u8();
26063 __struct.rssi = buf.get_u8();
26064 Ok(__struct)
26065 }
26066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26067 let mut __tmp = BytesMut::new(bytes);
26068 #[allow(clippy::absurd_extreme_comparisons)]
26069 #[allow(unused_comparisons)]
26070 if __tmp.remaining() < Self::ENCODED_LEN {
26071 panic!(
26072 "buffer is too small (need {} bytes, but got {})",
26073 Self::ENCODED_LEN,
26074 __tmp.remaining(),
26075 )
26076 }
26077 __tmp.put_u32_le(self.time_boot_ms);
26078 __tmp.put_u16_le(self.chan1_raw);
26079 __tmp.put_u16_le(self.chan2_raw);
26080 __tmp.put_u16_le(self.chan3_raw);
26081 __tmp.put_u16_le(self.chan4_raw);
26082 __tmp.put_u16_le(self.chan5_raw);
26083 __tmp.put_u16_le(self.chan6_raw);
26084 __tmp.put_u16_le(self.chan7_raw);
26085 __tmp.put_u16_le(self.chan8_raw);
26086 __tmp.put_u8(self.port);
26087 __tmp.put_u8(self.rssi);
26088 if matches!(version, MavlinkVersion::V2) {
26089 let len = __tmp.len();
26090 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26091 } else {
26092 __tmp.len()
26093 }
26094 }
26095}
26096#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
26097#[doc = ""]
26098#[doc = "ID: 34"]
26099#[derive(Debug, Clone, PartialEq)]
26100#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26102#[cfg_attr(feature = "ts", derive(TS))]
26103#[cfg_attr(feature = "ts", ts(export))]
26104pub struct RC_CHANNELS_SCALED_DATA {
26105 #[doc = "Timestamp (time since system boot)."]
26106 pub time_boot_ms: u32,
26107 #[doc = "RC channel 1 value scaled."]
26108 pub chan1_scaled: i16,
26109 #[doc = "RC channel 2 value scaled."]
26110 pub chan2_scaled: i16,
26111 #[doc = "RC channel 3 value scaled."]
26112 pub chan3_scaled: i16,
26113 #[doc = "RC channel 4 value scaled."]
26114 pub chan4_scaled: i16,
26115 #[doc = "RC channel 5 value scaled."]
26116 pub chan5_scaled: i16,
26117 #[doc = "RC channel 6 value scaled."]
26118 pub chan6_scaled: i16,
26119 #[doc = "RC channel 7 value scaled."]
26120 pub chan7_scaled: i16,
26121 #[doc = "RC channel 8 value scaled."]
26122 pub chan8_scaled: i16,
26123 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26124 pub port: u8,
26125 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26126 pub rssi: u8,
26127}
26128impl RC_CHANNELS_SCALED_DATA {
26129 pub const ENCODED_LEN: usize = 22usize;
26130 pub const DEFAULT: Self = Self {
26131 time_boot_ms: 0_u32,
26132 chan1_scaled: 0_i16,
26133 chan2_scaled: 0_i16,
26134 chan3_scaled: 0_i16,
26135 chan4_scaled: 0_i16,
26136 chan5_scaled: 0_i16,
26137 chan6_scaled: 0_i16,
26138 chan7_scaled: 0_i16,
26139 chan8_scaled: 0_i16,
26140 port: 0_u8,
26141 rssi: 0_u8,
26142 };
26143 #[cfg(feature = "arbitrary")]
26144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26145 use arbitrary::{Arbitrary, Unstructured};
26146 let mut buf = [0u8; 1024];
26147 rng.fill_bytes(&mut buf);
26148 let mut unstructured = Unstructured::new(&buf);
26149 Self::arbitrary(&mut unstructured).unwrap_or_default()
26150 }
26151}
26152impl Default for RC_CHANNELS_SCALED_DATA {
26153 fn default() -> Self {
26154 Self::DEFAULT.clone()
26155 }
26156}
26157impl MessageData for RC_CHANNELS_SCALED_DATA {
26158 type Message = MavMessage;
26159 const ID: u32 = 34u32;
26160 const NAME: &'static str = "RC_CHANNELS_SCALED";
26161 const EXTRA_CRC: u8 = 237u8;
26162 const ENCODED_LEN: usize = 22usize;
26163 fn deser(
26164 _version: MavlinkVersion,
26165 __input: &[u8],
26166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26167 let avail_len = __input.len();
26168 let mut payload_buf = [0; Self::ENCODED_LEN];
26169 let mut buf = if avail_len < Self::ENCODED_LEN {
26170 payload_buf[0..avail_len].copy_from_slice(__input);
26171 Bytes::new(&payload_buf)
26172 } else {
26173 Bytes::new(__input)
26174 };
26175 let mut __struct = Self::default();
26176 __struct.time_boot_ms = buf.get_u32_le();
26177 __struct.chan1_scaled = buf.get_i16_le();
26178 __struct.chan2_scaled = buf.get_i16_le();
26179 __struct.chan3_scaled = buf.get_i16_le();
26180 __struct.chan4_scaled = buf.get_i16_le();
26181 __struct.chan5_scaled = buf.get_i16_le();
26182 __struct.chan6_scaled = buf.get_i16_le();
26183 __struct.chan7_scaled = buf.get_i16_le();
26184 __struct.chan8_scaled = buf.get_i16_le();
26185 __struct.port = buf.get_u8();
26186 __struct.rssi = buf.get_u8();
26187 Ok(__struct)
26188 }
26189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26190 let mut __tmp = BytesMut::new(bytes);
26191 #[allow(clippy::absurd_extreme_comparisons)]
26192 #[allow(unused_comparisons)]
26193 if __tmp.remaining() < Self::ENCODED_LEN {
26194 panic!(
26195 "buffer is too small (need {} bytes, but got {})",
26196 Self::ENCODED_LEN,
26197 __tmp.remaining(),
26198 )
26199 }
26200 __tmp.put_u32_le(self.time_boot_ms);
26201 __tmp.put_i16_le(self.chan1_scaled);
26202 __tmp.put_i16_le(self.chan2_scaled);
26203 __tmp.put_i16_le(self.chan3_scaled);
26204 __tmp.put_i16_le(self.chan4_scaled);
26205 __tmp.put_i16_le(self.chan5_scaled);
26206 __tmp.put_i16_le(self.chan6_scaled);
26207 __tmp.put_i16_le(self.chan7_scaled);
26208 __tmp.put_i16_le(self.chan8_scaled);
26209 __tmp.put_u8(self.port);
26210 __tmp.put_u8(self.rssi);
26211 if matches!(version, MavlinkVersion::V2) {
26212 let len = __tmp.len();
26213 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26214 } else {
26215 __tmp.len()
26216 }
26217 }
26218}
26219#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26220#[doc = "Request a data stream."]
26221#[doc = ""]
26222#[doc = "ID: 66"]
26223#[derive(Debug, Clone, PartialEq)]
26224#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26225#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26226#[cfg_attr(feature = "ts", derive(TS))]
26227#[cfg_attr(feature = "ts", ts(export))]
26228pub struct REQUEST_DATA_STREAM_DATA {
26229 #[doc = "The requested message rate"]
26230 pub req_message_rate: u16,
26231 #[doc = "The target requested to send the message stream."]
26232 pub target_system: u8,
26233 #[doc = "The target requested to send the message stream."]
26234 pub target_component: u8,
26235 #[doc = "The ID of the requested data stream"]
26236 pub req_stream_id: u8,
26237 #[doc = "1 to start sending, 0 to stop sending."]
26238 pub start_stop: u8,
26239}
26240impl REQUEST_DATA_STREAM_DATA {
26241 pub const ENCODED_LEN: usize = 6usize;
26242 pub const DEFAULT: Self = Self {
26243 req_message_rate: 0_u16,
26244 target_system: 0_u8,
26245 target_component: 0_u8,
26246 req_stream_id: 0_u8,
26247 start_stop: 0_u8,
26248 };
26249 #[cfg(feature = "arbitrary")]
26250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26251 use arbitrary::{Arbitrary, Unstructured};
26252 let mut buf = [0u8; 1024];
26253 rng.fill_bytes(&mut buf);
26254 let mut unstructured = Unstructured::new(&buf);
26255 Self::arbitrary(&mut unstructured).unwrap_or_default()
26256 }
26257}
26258impl Default for REQUEST_DATA_STREAM_DATA {
26259 fn default() -> Self {
26260 Self::DEFAULT.clone()
26261 }
26262}
26263impl MessageData for REQUEST_DATA_STREAM_DATA {
26264 type Message = MavMessage;
26265 const ID: u32 = 66u32;
26266 const NAME: &'static str = "REQUEST_DATA_STREAM";
26267 const EXTRA_CRC: u8 = 148u8;
26268 const ENCODED_LEN: usize = 6usize;
26269 fn deser(
26270 _version: MavlinkVersion,
26271 __input: &[u8],
26272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26273 let avail_len = __input.len();
26274 let mut payload_buf = [0; Self::ENCODED_LEN];
26275 let mut buf = if avail_len < Self::ENCODED_LEN {
26276 payload_buf[0..avail_len].copy_from_slice(__input);
26277 Bytes::new(&payload_buf)
26278 } else {
26279 Bytes::new(__input)
26280 };
26281 let mut __struct = Self::default();
26282 __struct.req_message_rate = buf.get_u16_le();
26283 __struct.target_system = buf.get_u8();
26284 __struct.target_component = buf.get_u8();
26285 __struct.req_stream_id = buf.get_u8();
26286 __struct.start_stop = buf.get_u8();
26287 Ok(__struct)
26288 }
26289 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26290 let mut __tmp = BytesMut::new(bytes);
26291 #[allow(clippy::absurd_extreme_comparisons)]
26292 #[allow(unused_comparisons)]
26293 if __tmp.remaining() < Self::ENCODED_LEN {
26294 panic!(
26295 "buffer is too small (need {} bytes, but got {})",
26296 Self::ENCODED_LEN,
26297 __tmp.remaining(),
26298 )
26299 }
26300 __tmp.put_u16_le(self.req_message_rate);
26301 __tmp.put_u8(self.target_system);
26302 __tmp.put_u8(self.target_component);
26303 __tmp.put_u8(self.req_stream_id);
26304 __tmp.put_u8(self.start_stop);
26305 if matches!(version, MavlinkVersion::V2) {
26306 let len = __tmp.len();
26307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26308 } else {
26309 __tmp.len()
26310 }
26311 }
26312}
26313#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26314#[doc = ""]
26315#[doc = "ID: 412"]
26316#[derive(Debug, Clone, PartialEq)]
26317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26319#[cfg_attr(feature = "ts", derive(TS))]
26320#[cfg_attr(feature = "ts", ts(export))]
26321pub struct REQUEST_EVENT_DATA {
26322 #[doc = "First sequence number of the requested event."]
26323 pub first_sequence: u16,
26324 #[doc = "Last sequence number of the requested event."]
26325 pub last_sequence: u16,
26326 #[doc = "System ID"]
26327 pub target_system: u8,
26328 #[doc = "Component ID"]
26329 pub target_component: u8,
26330}
26331impl REQUEST_EVENT_DATA {
26332 pub const ENCODED_LEN: usize = 6usize;
26333 pub const DEFAULT: Self = Self {
26334 first_sequence: 0_u16,
26335 last_sequence: 0_u16,
26336 target_system: 0_u8,
26337 target_component: 0_u8,
26338 };
26339 #[cfg(feature = "arbitrary")]
26340 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26341 use arbitrary::{Arbitrary, Unstructured};
26342 let mut buf = [0u8; 1024];
26343 rng.fill_bytes(&mut buf);
26344 let mut unstructured = Unstructured::new(&buf);
26345 Self::arbitrary(&mut unstructured).unwrap_or_default()
26346 }
26347}
26348impl Default for REQUEST_EVENT_DATA {
26349 fn default() -> Self {
26350 Self::DEFAULT.clone()
26351 }
26352}
26353impl MessageData for REQUEST_EVENT_DATA {
26354 type Message = MavMessage;
26355 const ID: u32 = 412u32;
26356 const NAME: &'static str = "REQUEST_EVENT";
26357 const EXTRA_CRC: u8 = 33u8;
26358 const ENCODED_LEN: usize = 6usize;
26359 fn deser(
26360 _version: MavlinkVersion,
26361 __input: &[u8],
26362 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26363 let avail_len = __input.len();
26364 let mut payload_buf = [0; Self::ENCODED_LEN];
26365 let mut buf = if avail_len < Self::ENCODED_LEN {
26366 payload_buf[0..avail_len].copy_from_slice(__input);
26367 Bytes::new(&payload_buf)
26368 } else {
26369 Bytes::new(__input)
26370 };
26371 let mut __struct = Self::default();
26372 __struct.first_sequence = buf.get_u16_le();
26373 __struct.last_sequence = buf.get_u16_le();
26374 __struct.target_system = buf.get_u8();
26375 __struct.target_component = buf.get_u8();
26376 Ok(__struct)
26377 }
26378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26379 let mut __tmp = BytesMut::new(bytes);
26380 #[allow(clippy::absurd_extreme_comparisons)]
26381 #[allow(unused_comparisons)]
26382 if __tmp.remaining() < Self::ENCODED_LEN {
26383 panic!(
26384 "buffer is too small (need {} bytes, but got {})",
26385 Self::ENCODED_LEN,
26386 __tmp.remaining(),
26387 )
26388 }
26389 __tmp.put_u16_le(self.first_sequence);
26390 __tmp.put_u16_le(self.last_sequence);
26391 __tmp.put_u8(self.target_system);
26392 __tmp.put_u8(self.target_component);
26393 if matches!(version, MavlinkVersion::V2) {
26394 let len = __tmp.len();
26395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26396 } else {
26397 __tmp.len()
26398 }
26399 }
26400}
26401#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26402#[doc = ""]
26403#[doc = "ID: 142"]
26404#[derive(Debug, Clone, PartialEq)]
26405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26407#[cfg_attr(feature = "ts", derive(TS))]
26408#[cfg_attr(feature = "ts", ts(export))]
26409pub struct RESOURCE_REQUEST_DATA {
26410 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26411 pub request_id: u8,
26412 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26413 pub uri_type: u8,
26414 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26415 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26416 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26417 pub uri: [u8; 120],
26418 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26419 pub transfer_type: u8,
26420 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26421 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26422 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26423 pub storage: [u8; 120],
26424}
26425impl RESOURCE_REQUEST_DATA {
26426 pub const ENCODED_LEN: usize = 243usize;
26427 pub const DEFAULT: Self = Self {
26428 request_id: 0_u8,
26429 uri_type: 0_u8,
26430 uri: [0_u8; 120usize],
26431 transfer_type: 0_u8,
26432 storage: [0_u8; 120usize],
26433 };
26434 #[cfg(feature = "arbitrary")]
26435 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26436 use arbitrary::{Arbitrary, Unstructured};
26437 let mut buf = [0u8; 1024];
26438 rng.fill_bytes(&mut buf);
26439 let mut unstructured = Unstructured::new(&buf);
26440 Self::arbitrary(&mut unstructured).unwrap_or_default()
26441 }
26442}
26443impl Default for RESOURCE_REQUEST_DATA {
26444 fn default() -> Self {
26445 Self::DEFAULT.clone()
26446 }
26447}
26448impl MessageData for RESOURCE_REQUEST_DATA {
26449 type Message = MavMessage;
26450 const ID: u32 = 142u32;
26451 const NAME: &'static str = "RESOURCE_REQUEST";
26452 const EXTRA_CRC: u8 = 72u8;
26453 const ENCODED_LEN: usize = 243usize;
26454 fn deser(
26455 _version: MavlinkVersion,
26456 __input: &[u8],
26457 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26458 let avail_len = __input.len();
26459 let mut payload_buf = [0; Self::ENCODED_LEN];
26460 let mut buf = if avail_len < Self::ENCODED_LEN {
26461 payload_buf[0..avail_len].copy_from_slice(__input);
26462 Bytes::new(&payload_buf)
26463 } else {
26464 Bytes::new(__input)
26465 };
26466 let mut __struct = Self::default();
26467 __struct.request_id = buf.get_u8();
26468 __struct.uri_type = buf.get_u8();
26469 for v in &mut __struct.uri {
26470 let val = buf.get_u8();
26471 *v = val;
26472 }
26473 __struct.transfer_type = buf.get_u8();
26474 for v in &mut __struct.storage {
26475 let val = buf.get_u8();
26476 *v = val;
26477 }
26478 Ok(__struct)
26479 }
26480 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26481 let mut __tmp = BytesMut::new(bytes);
26482 #[allow(clippy::absurd_extreme_comparisons)]
26483 #[allow(unused_comparisons)]
26484 if __tmp.remaining() < Self::ENCODED_LEN {
26485 panic!(
26486 "buffer is too small (need {} bytes, but got {})",
26487 Self::ENCODED_LEN,
26488 __tmp.remaining(),
26489 )
26490 }
26491 __tmp.put_u8(self.request_id);
26492 __tmp.put_u8(self.uri_type);
26493 for val in &self.uri {
26494 __tmp.put_u8(*val);
26495 }
26496 __tmp.put_u8(self.transfer_type);
26497 for val in &self.storage {
26498 __tmp.put_u8(*val);
26499 }
26500 if matches!(version, MavlinkVersion::V2) {
26501 let len = __tmp.len();
26502 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26503 } else {
26504 __tmp.len()
26505 }
26506 }
26507}
26508#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26509#[doc = ""]
26510#[doc = "ID: 413"]
26511#[derive(Debug, Clone, PartialEq)]
26512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26513#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26514#[cfg_attr(feature = "ts", derive(TS))]
26515#[cfg_attr(feature = "ts", ts(export))]
26516pub struct RESPONSE_EVENT_ERROR_DATA {
26517 #[doc = "Sequence number."]
26518 pub sequence: u16,
26519 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26520 pub sequence_oldest_available: u16,
26521 #[doc = "System ID"]
26522 pub target_system: u8,
26523 #[doc = "Component ID"]
26524 pub target_component: u8,
26525 #[doc = "Error reason."]
26526 pub reason: MavEventErrorReason,
26527}
26528impl RESPONSE_EVENT_ERROR_DATA {
26529 pub const ENCODED_LEN: usize = 7usize;
26530 pub const DEFAULT: Self = Self {
26531 sequence: 0_u16,
26532 sequence_oldest_available: 0_u16,
26533 target_system: 0_u8,
26534 target_component: 0_u8,
26535 reason: MavEventErrorReason::DEFAULT,
26536 };
26537 #[cfg(feature = "arbitrary")]
26538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26539 use arbitrary::{Arbitrary, Unstructured};
26540 let mut buf = [0u8; 1024];
26541 rng.fill_bytes(&mut buf);
26542 let mut unstructured = Unstructured::new(&buf);
26543 Self::arbitrary(&mut unstructured).unwrap_or_default()
26544 }
26545}
26546impl Default for RESPONSE_EVENT_ERROR_DATA {
26547 fn default() -> Self {
26548 Self::DEFAULT.clone()
26549 }
26550}
26551impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26552 type Message = MavMessage;
26553 const ID: u32 = 413u32;
26554 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26555 const EXTRA_CRC: u8 = 77u8;
26556 const ENCODED_LEN: usize = 7usize;
26557 fn deser(
26558 _version: MavlinkVersion,
26559 __input: &[u8],
26560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26561 let avail_len = __input.len();
26562 let mut payload_buf = [0; Self::ENCODED_LEN];
26563 let mut buf = if avail_len < Self::ENCODED_LEN {
26564 payload_buf[0..avail_len].copy_from_slice(__input);
26565 Bytes::new(&payload_buf)
26566 } else {
26567 Bytes::new(__input)
26568 };
26569 let mut __struct = Self::default();
26570 __struct.sequence = buf.get_u16_le();
26571 __struct.sequence_oldest_available = buf.get_u16_le();
26572 __struct.target_system = buf.get_u8();
26573 __struct.target_component = buf.get_u8();
26574 let tmp = buf.get_u8();
26575 __struct.reason =
26576 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26577 enum_type: "MavEventErrorReason",
26578 value: tmp as u32,
26579 })?;
26580 Ok(__struct)
26581 }
26582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26583 let mut __tmp = BytesMut::new(bytes);
26584 #[allow(clippy::absurd_extreme_comparisons)]
26585 #[allow(unused_comparisons)]
26586 if __tmp.remaining() < Self::ENCODED_LEN {
26587 panic!(
26588 "buffer is too small (need {} bytes, but got {})",
26589 Self::ENCODED_LEN,
26590 __tmp.remaining(),
26591 )
26592 }
26593 __tmp.put_u16_le(self.sequence);
26594 __tmp.put_u16_le(self.sequence_oldest_available);
26595 __tmp.put_u8(self.target_system);
26596 __tmp.put_u8(self.target_component);
26597 __tmp.put_u8(self.reason as u8);
26598 if matches!(version, MavlinkVersion::V2) {
26599 let len = __tmp.len();
26600 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26601 } else {
26602 __tmp.len()
26603 }
26604 }
26605}
26606#[doc = "Read out the safety zone the MAV currently assumes."]
26607#[doc = ""]
26608#[doc = "ID: 55"]
26609#[derive(Debug, Clone, PartialEq)]
26610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26611#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26612#[cfg_attr(feature = "ts", derive(TS))]
26613#[cfg_attr(feature = "ts", ts(export))]
26614pub struct SAFETY_ALLOWED_AREA_DATA {
26615 #[doc = "x position 1 / Latitude 1"]
26616 pub p1x: f32,
26617 #[doc = "y position 1 / Longitude 1"]
26618 pub p1y: f32,
26619 #[doc = "z position 1 / Altitude 1"]
26620 pub p1z: f32,
26621 #[doc = "x position 2 / Latitude 2"]
26622 pub p2x: f32,
26623 #[doc = "y position 2 / Longitude 2"]
26624 pub p2y: f32,
26625 #[doc = "z position 2 / Altitude 2"]
26626 pub p2z: f32,
26627 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26628 pub frame: MavFrame,
26629}
26630impl SAFETY_ALLOWED_AREA_DATA {
26631 pub const ENCODED_LEN: usize = 25usize;
26632 pub const DEFAULT: Self = Self {
26633 p1x: 0.0_f32,
26634 p1y: 0.0_f32,
26635 p1z: 0.0_f32,
26636 p2x: 0.0_f32,
26637 p2y: 0.0_f32,
26638 p2z: 0.0_f32,
26639 frame: MavFrame::DEFAULT,
26640 };
26641 #[cfg(feature = "arbitrary")]
26642 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26643 use arbitrary::{Arbitrary, Unstructured};
26644 let mut buf = [0u8; 1024];
26645 rng.fill_bytes(&mut buf);
26646 let mut unstructured = Unstructured::new(&buf);
26647 Self::arbitrary(&mut unstructured).unwrap_or_default()
26648 }
26649}
26650impl Default for SAFETY_ALLOWED_AREA_DATA {
26651 fn default() -> Self {
26652 Self::DEFAULT.clone()
26653 }
26654}
26655impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26656 type Message = MavMessage;
26657 const ID: u32 = 55u32;
26658 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26659 const EXTRA_CRC: u8 = 3u8;
26660 const ENCODED_LEN: usize = 25usize;
26661 fn deser(
26662 _version: MavlinkVersion,
26663 __input: &[u8],
26664 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26665 let avail_len = __input.len();
26666 let mut payload_buf = [0; Self::ENCODED_LEN];
26667 let mut buf = if avail_len < Self::ENCODED_LEN {
26668 payload_buf[0..avail_len].copy_from_slice(__input);
26669 Bytes::new(&payload_buf)
26670 } else {
26671 Bytes::new(__input)
26672 };
26673 let mut __struct = Self::default();
26674 __struct.p1x = buf.get_f32_le();
26675 __struct.p1y = buf.get_f32_le();
26676 __struct.p1z = buf.get_f32_le();
26677 __struct.p2x = buf.get_f32_le();
26678 __struct.p2y = buf.get_f32_le();
26679 __struct.p2z = buf.get_f32_le();
26680 let tmp = buf.get_u8();
26681 __struct.frame =
26682 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26683 enum_type: "MavFrame",
26684 value: tmp as u32,
26685 })?;
26686 Ok(__struct)
26687 }
26688 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26689 let mut __tmp = BytesMut::new(bytes);
26690 #[allow(clippy::absurd_extreme_comparisons)]
26691 #[allow(unused_comparisons)]
26692 if __tmp.remaining() < Self::ENCODED_LEN {
26693 panic!(
26694 "buffer is too small (need {} bytes, but got {})",
26695 Self::ENCODED_LEN,
26696 __tmp.remaining(),
26697 )
26698 }
26699 __tmp.put_f32_le(self.p1x);
26700 __tmp.put_f32_le(self.p1y);
26701 __tmp.put_f32_le(self.p1z);
26702 __tmp.put_f32_le(self.p2x);
26703 __tmp.put_f32_le(self.p2y);
26704 __tmp.put_f32_le(self.p2z);
26705 __tmp.put_u8(self.frame as u8);
26706 if matches!(version, MavlinkVersion::V2) {
26707 let len = __tmp.len();
26708 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26709 } else {
26710 __tmp.len()
26711 }
26712 }
26713}
26714#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26715#[doc = ""]
26716#[doc = "ID: 54"]
26717#[derive(Debug, Clone, PartialEq)]
26718#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26719#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26720#[cfg_attr(feature = "ts", derive(TS))]
26721#[cfg_attr(feature = "ts", ts(export))]
26722pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26723 #[doc = "x position 1 / Latitude 1"]
26724 pub p1x: f32,
26725 #[doc = "y position 1 / Longitude 1"]
26726 pub p1y: f32,
26727 #[doc = "z position 1 / Altitude 1"]
26728 pub p1z: f32,
26729 #[doc = "x position 2 / Latitude 2"]
26730 pub p2x: f32,
26731 #[doc = "y position 2 / Longitude 2"]
26732 pub p2y: f32,
26733 #[doc = "z position 2 / Altitude 2"]
26734 pub p2z: f32,
26735 #[doc = "System ID"]
26736 pub target_system: u8,
26737 #[doc = "Component ID"]
26738 pub target_component: u8,
26739 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26740 pub frame: MavFrame,
26741}
26742impl SAFETY_SET_ALLOWED_AREA_DATA {
26743 pub const ENCODED_LEN: usize = 27usize;
26744 pub const DEFAULT: Self = Self {
26745 p1x: 0.0_f32,
26746 p1y: 0.0_f32,
26747 p1z: 0.0_f32,
26748 p2x: 0.0_f32,
26749 p2y: 0.0_f32,
26750 p2z: 0.0_f32,
26751 target_system: 0_u8,
26752 target_component: 0_u8,
26753 frame: MavFrame::DEFAULT,
26754 };
26755 #[cfg(feature = "arbitrary")]
26756 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26757 use arbitrary::{Arbitrary, Unstructured};
26758 let mut buf = [0u8; 1024];
26759 rng.fill_bytes(&mut buf);
26760 let mut unstructured = Unstructured::new(&buf);
26761 Self::arbitrary(&mut unstructured).unwrap_or_default()
26762 }
26763}
26764impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26765 fn default() -> Self {
26766 Self::DEFAULT.clone()
26767 }
26768}
26769impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26770 type Message = MavMessage;
26771 const ID: u32 = 54u32;
26772 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26773 const EXTRA_CRC: u8 = 15u8;
26774 const ENCODED_LEN: usize = 27usize;
26775 fn deser(
26776 _version: MavlinkVersion,
26777 __input: &[u8],
26778 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26779 let avail_len = __input.len();
26780 let mut payload_buf = [0; Self::ENCODED_LEN];
26781 let mut buf = if avail_len < Self::ENCODED_LEN {
26782 payload_buf[0..avail_len].copy_from_slice(__input);
26783 Bytes::new(&payload_buf)
26784 } else {
26785 Bytes::new(__input)
26786 };
26787 let mut __struct = Self::default();
26788 __struct.p1x = buf.get_f32_le();
26789 __struct.p1y = buf.get_f32_le();
26790 __struct.p1z = buf.get_f32_le();
26791 __struct.p2x = buf.get_f32_le();
26792 __struct.p2y = buf.get_f32_le();
26793 __struct.p2z = buf.get_f32_le();
26794 __struct.target_system = buf.get_u8();
26795 __struct.target_component = buf.get_u8();
26796 let tmp = buf.get_u8();
26797 __struct.frame =
26798 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26799 enum_type: "MavFrame",
26800 value: tmp as u32,
26801 })?;
26802 Ok(__struct)
26803 }
26804 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26805 let mut __tmp = BytesMut::new(bytes);
26806 #[allow(clippy::absurd_extreme_comparisons)]
26807 #[allow(unused_comparisons)]
26808 if __tmp.remaining() < Self::ENCODED_LEN {
26809 panic!(
26810 "buffer is too small (need {} bytes, but got {})",
26811 Self::ENCODED_LEN,
26812 __tmp.remaining(),
26813 )
26814 }
26815 __tmp.put_f32_le(self.p1x);
26816 __tmp.put_f32_le(self.p1y);
26817 __tmp.put_f32_le(self.p1z);
26818 __tmp.put_f32_le(self.p2x);
26819 __tmp.put_f32_le(self.p2y);
26820 __tmp.put_f32_le(self.p2z);
26821 __tmp.put_u8(self.target_system);
26822 __tmp.put_u8(self.target_component);
26823 __tmp.put_u8(self.frame as u8);
26824 if matches!(version, MavlinkVersion::V2) {
26825 let len = __tmp.len();
26826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26827 } else {
26828 __tmp.len()
26829 }
26830 }
26831}
26832#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26833#[doc = ""]
26834#[doc = "ID: 26"]
26835#[derive(Debug, Clone, PartialEq)]
26836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26837#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26838#[cfg_attr(feature = "ts", derive(TS))]
26839#[cfg_attr(feature = "ts", ts(export))]
26840pub struct SCALED_IMU_DATA {
26841 #[doc = "Timestamp (time since system boot)."]
26842 pub time_boot_ms: u32,
26843 #[doc = "X acceleration"]
26844 pub xacc: i16,
26845 #[doc = "Y acceleration"]
26846 pub yacc: i16,
26847 #[doc = "Z acceleration"]
26848 pub zacc: i16,
26849 #[doc = "Angular speed around X axis"]
26850 pub xgyro: i16,
26851 #[doc = "Angular speed around Y axis"]
26852 pub ygyro: i16,
26853 #[doc = "Angular speed around Z axis"]
26854 pub zgyro: i16,
26855 #[doc = "X Magnetic field"]
26856 pub xmag: i16,
26857 #[doc = "Y Magnetic field"]
26858 pub ymag: i16,
26859 #[doc = "Z Magnetic field"]
26860 pub zmag: i16,
26861 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26862 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26863 pub temperature: i16,
26864}
26865impl SCALED_IMU_DATA {
26866 pub const ENCODED_LEN: usize = 24usize;
26867 pub const DEFAULT: Self = Self {
26868 time_boot_ms: 0_u32,
26869 xacc: 0_i16,
26870 yacc: 0_i16,
26871 zacc: 0_i16,
26872 xgyro: 0_i16,
26873 ygyro: 0_i16,
26874 zgyro: 0_i16,
26875 xmag: 0_i16,
26876 ymag: 0_i16,
26877 zmag: 0_i16,
26878 temperature: 0_i16,
26879 };
26880 #[cfg(feature = "arbitrary")]
26881 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26882 use arbitrary::{Arbitrary, Unstructured};
26883 let mut buf = [0u8; 1024];
26884 rng.fill_bytes(&mut buf);
26885 let mut unstructured = Unstructured::new(&buf);
26886 Self::arbitrary(&mut unstructured).unwrap_or_default()
26887 }
26888}
26889impl Default for SCALED_IMU_DATA {
26890 fn default() -> Self {
26891 Self::DEFAULT.clone()
26892 }
26893}
26894impl MessageData for SCALED_IMU_DATA {
26895 type Message = MavMessage;
26896 const ID: u32 = 26u32;
26897 const NAME: &'static str = "SCALED_IMU";
26898 const EXTRA_CRC: u8 = 170u8;
26899 const ENCODED_LEN: usize = 24usize;
26900 fn deser(
26901 _version: MavlinkVersion,
26902 __input: &[u8],
26903 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26904 let avail_len = __input.len();
26905 let mut payload_buf = [0; Self::ENCODED_LEN];
26906 let mut buf = if avail_len < Self::ENCODED_LEN {
26907 payload_buf[0..avail_len].copy_from_slice(__input);
26908 Bytes::new(&payload_buf)
26909 } else {
26910 Bytes::new(__input)
26911 };
26912 let mut __struct = Self::default();
26913 __struct.time_boot_ms = buf.get_u32_le();
26914 __struct.xacc = buf.get_i16_le();
26915 __struct.yacc = buf.get_i16_le();
26916 __struct.zacc = buf.get_i16_le();
26917 __struct.xgyro = buf.get_i16_le();
26918 __struct.ygyro = buf.get_i16_le();
26919 __struct.zgyro = buf.get_i16_le();
26920 __struct.xmag = buf.get_i16_le();
26921 __struct.ymag = buf.get_i16_le();
26922 __struct.zmag = buf.get_i16_le();
26923 __struct.temperature = buf.get_i16_le();
26924 Ok(__struct)
26925 }
26926 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26927 let mut __tmp = BytesMut::new(bytes);
26928 #[allow(clippy::absurd_extreme_comparisons)]
26929 #[allow(unused_comparisons)]
26930 if __tmp.remaining() < Self::ENCODED_LEN {
26931 panic!(
26932 "buffer is too small (need {} bytes, but got {})",
26933 Self::ENCODED_LEN,
26934 __tmp.remaining(),
26935 )
26936 }
26937 __tmp.put_u32_le(self.time_boot_ms);
26938 __tmp.put_i16_le(self.xacc);
26939 __tmp.put_i16_le(self.yacc);
26940 __tmp.put_i16_le(self.zacc);
26941 __tmp.put_i16_le(self.xgyro);
26942 __tmp.put_i16_le(self.ygyro);
26943 __tmp.put_i16_le(self.zgyro);
26944 __tmp.put_i16_le(self.xmag);
26945 __tmp.put_i16_le(self.ymag);
26946 __tmp.put_i16_le(self.zmag);
26947 if matches!(version, MavlinkVersion::V2) {
26948 __tmp.put_i16_le(self.temperature);
26949 let len = __tmp.len();
26950 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26951 } else {
26952 __tmp.len()
26953 }
26954 }
26955}
26956#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26957#[doc = ""]
26958#[doc = "ID: 116"]
26959#[derive(Debug, Clone, PartialEq)]
26960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26962#[cfg_attr(feature = "ts", derive(TS))]
26963#[cfg_attr(feature = "ts", ts(export))]
26964pub struct SCALED_IMU2_DATA {
26965 #[doc = "Timestamp (time since system boot)."]
26966 pub time_boot_ms: u32,
26967 #[doc = "X acceleration"]
26968 pub xacc: i16,
26969 #[doc = "Y acceleration"]
26970 pub yacc: i16,
26971 #[doc = "Z acceleration"]
26972 pub zacc: i16,
26973 #[doc = "Angular speed around X axis"]
26974 pub xgyro: i16,
26975 #[doc = "Angular speed around Y axis"]
26976 pub ygyro: i16,
26977 #[doc = "Angular speed around Z axis"]
26978 pub zgyro: i16,
26979 #[doc = "X Magnetic field"]
26980 pub xmag: i16,
26981 #[doc = "Y Magnetic field"]
26982 pub ymag: i16,
26983 #[doc = "Z Magnetic field"]
26984 pub zmag: i16,
26985 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26986 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26987 pub temperature: i16,
26988}
26989impl SCALED_IMU2_DATA {
26990 pub const ENCODED_LEN: usize = 24usize;
26991 pub const DEFAULT: Self = Self {
26992 time_boot_ms: 0_u32,
26993 xacc: 0_i16,
26994 yacc: 0_i16,
26995 zacc: 0_i16,
26996 xgyro: 0_i16,
26997 ygyro: 0_i16,
26998 zgyro: 0_i16,
26999 xmag: 0_i16,
27000 ymag: 0_i16,
27001 zmag: 0_i16,
27002 temperature: 0_i16,
27003 };
27004 #[cfg(feature = "arbitrary")]
27005 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27006 use arbitrary::{Arbitrary, Unstructured};
27007 let mut buf = [0u8; 1024];
27008 rng.fill_bytes(&mut buf);
27009 let mut unstructured = Unstructured::new(&buf);
27010 Self::arbitrary(&mut unstructured).unwrap_or_default()
27011 }
27012}
27013impl Default for SCALED_IMU2_DATA {
27014 fn default() -> Self {
27015 Self::DEFAULT.clone()
27016 }
27017}
27018impl MessageData for SCALED_IMU2_DATA {
27019 type Message = MavMessage;
27020 const ID: u32 = 116u32;
27021 const NAME: &'static str = "SCALED_IMU2";
27022 const EXTRA_CRC: u8 = 76u8;
27023 const ENCODED_LEN: usize = 24usize;
27024 fn deser(
27025 _version: MavlinkVersion,
27026 __input: &[u8],
27027 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27028 let avail_len = __input.len();
27029 let mut payload_buf = [0; Self::ENCODED_LEN];
27030 let mut buf = if avail_len < Self::ENCODED_LEN {
27031 payload_buf[0..avail_len].copy_from_slice(__input);
27032 Bytes::new(&payload_buf)
27033 } else {
27034 Bytes::new(__input)
27035 };
27036 let mut __struct = Self::default();
27037 __struct.time_boot_ms = buf.get_u32_le();
27038 __struct.xacc = buf.get_i16_le();
27039 __struct.yacc = buf.get_i16_le();
27040 __struct.zacc = buf.get_i16_le();
27041 __struct.xgyro = buf.get_i16_le();
27042 __struct.ygyro = buf.get_i16_le();
27043 __struct.zgyro = buf.get_i16_le();
27044 __struct.xmag = buf.get_i16_le();
27045 __struct.ymag = buf.get_i16_le();
27046 __struct.zmag = buf.get_i16_le();
27047 __struct.temperature = buf.get_i16_le();
27048 Ok(__struct)
27049 }
27050 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27051 let mut __tmp = BytesMut::new(bytes);
27052 #[allow(clippy::absurd_extreme_comparisons)]
27053 #[allow(unused_comparisons)]
27054 if __tmp.remaining() < Self::ENCODED_LEN {
27055 panic!(
27056 "buffer is too small (need {} bytes, but got {})",
27057 Self::ENCODED_LEN,
27058 __tmp.remaining(),
27059 )
27060 }
27061 __tmp.put_u32_le(self.time_boot_ms);
27062 __tmp.put_i16_le(self.xacc);
27063 __tmp.put_i16_le(self.yacc);
27064 __tmp.put_i16_le(self.zacc);
27065 __tmp.put_i16_le(self.xgyro);
27066 __tmp.put_i16_le(self.ygyro);
27067 __tmp.put_i16_le(self.zgyro);
27068 __tmp.put_i16_le(self.xmag);
27069 __tmp.put_i16_le(self.ymag);
27070 __tmp.put_i16_le(self.zmag);
27071 if matches!(version, MavlinkVersion::V2) {
27072 __tmp.put_i16_le(self.temperature);
27073 let len = __tmp.len();
27074 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27075 } else {
27076 __tmp.len()
27077 }
27078 }
27079}
27080#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27081#[doc = ""]
27082#[doc = "ID: 129"]
27083#[derive(Debug, Clone, PartialEq)]
27084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27086#[cfg_attr(feature = "ts", derive(TS))]
27087#[cfg_attr(feature = "ts", ts(export))]
27088pub struct SCALED_IMU3_DATA {
27089 #[doc = "Timestamp (time since system boot)."]
27090 pub time_boot_ms: u32,
27091 #[doc = "X acceleration"]
27092 pub xacc: i16,
27093 #[doc = "Y acceleration"]
27094 pub yacc: i16,
27095 #[doc = "Z acceleration"]
27096 pub zacc: i16,
27097 #[doc = "Angular speed around X axis"]
27098 pub xgyro: i16,
27099 #[doc = "Angular speed around Y axis"]
27100 pub ygyro: i16,
27101 #[doc = "Angular speed around Z axis"]
27102 pub zgyro: i16,
27103 #[doc = "X Magnetic field"]
27104 pub xmag: i16,
27105 #[doc = "Y Magnetic field"]
27106 pub ymag: i16,
27107 #[doc = "Z Magnetic field"]
27108 pub zmag: i16,
27109 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27110 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27111 pub temperature: i16,
27112}
27113impl SCALED_IMU3_DATA {
27114 pub const ENCODED_LEN: usize = 24usize;
27115 pub const DEFAULT: Self = Self {
27116 time_boot_ms: 0_u32,
27117 xacc: 0_i16,
27118 yacc: 0_i16,
27119 zacc: 0_i16,
27120 xgyro: 0_i16,
27121 ygyro: 0_i16,
27122 zgyro: 0_i16,
27123 xmag: 0_i16,
27124 ymag: 0_i16,
27125 zmag: 0_i16,
27126 temperature: 0_i16,
27127 };
27128 #[cfg(feature = "arbitrary")]
27129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27130 use arbitrary::{Arbitrary, Unstructured};
27131 let mut buf = [0u8; 1024];
27132 rng.fill_bytes(&mut buf);
27133 let mut unstructured = Unstructured::new(&buf);
27134 Self::arbitrary(&mut unstructured).unwrap_or_default()
27135 }
27136}
27137impl Default for SCALED_IMU3_DATA {
27138 fn default() -> Self {
27139 Self::DEFAULT.clone()
27140 }
27141}
27142impl MessageData for SCALED_IMU3_DATA {
27143 type Message = MavMessage;
27144 const ID: u32 = 129u32;
27145 const NAME: &'static str = "SCALED_IMU3";
27146 const EXTRA_CRC: u8 = 46u8;
27147 const ENCODED_LEN: usize = 24usize;
27148 fn deser(
27149 _version: MavlinkVersion,
27150 __input: &[u8],
27151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27152 let avail_len = __input.len();
27153 let mut payload_buf = [0; Self::ENCODED_LEN];
27154 let mut buf = if avail_len < Self::ENCODED_LEN {
27155 payload_buf[0..avail_len].copy_from_slice(__input);
27156 Bytes::new(&payload_buf)
27157 } else {
27158 Bytes::new(__input)
27159 };
27160 let mut __struct = Self::default();
27161 __struct.time_boot_ms = buf.get_u32_le();
27162 __struct.xacc = buf.get_i16_le();
27163 __struct.yacc = buf.get_i16_le();
27164 __struct.zacc = buf.get_i16_le();
27165 __struct.xgyro = buf.get_i16_le();
27166 __struct.ygyro = buf.get_i16_le();
27167 __struct.zgyro = buf.get_i16_le();
27168 __struct.xmag = buf.get_i16_le();
27169 __struct.ymag = buf.get_i16_le();
27170 __struct.zmag = buf.get_i16_le();
27171 __struct.temperature = buf.get_i16_le();
27172 Ok(__struct)
27173 }
27174 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27175 let mut __tmp = BytesMut::new(bytes);
27176 #[allow(clippy::absurd_extreme_comparisons)]
27177 #[allow(unused_comparisons)]
27178 if __tmp.remaining() < Self::ENCODED_LEN {
27179 panic!(
27180 "buffer is too small (need {} bytes, but got {})",
27181 Self::ENCODED_LEN,
27182 __tmp.remaining(),
27183 )
27184 }
27185 __tmp.put_u32_le(self.time_boot_ms);
27186 __tmp.put_i16_le(self.xacc);
27187 __tmp.put_i16_le(self.yacc);
27188 __tmp.put_i16_le(self.zacc);
27189 __tmp.put_i16_le(self.xgyro);
27190 __tmp.put_i16_le(self.ygyro);
27191 __tmp.put_i16_le(self.zgyro);
27192 __tmp.put_i16_le(self.xmag);
27193 __tmp.put_i16_le(self.ymag);
27194 __tmp.put_i16_le(self.zmag);
27195 if matches!(version, MavlinkVersion::V2) {
27196 __tmp.put_i16_le(self.temperature);
27197 let len = __tmp.len();
27198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27199 } else {
27200 __tmp.len()
27201 }
27202 }
27203}
27204#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27205#[doc = ""]
27206#[doc = "ID: 29"]
27207#[derive(Debug, Clone, PartialEq)]
27208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27210#[cfg_attr(feature = "ts", derive(TS))]
27211#[cfg_attr(feature = "ts", ts(export))]
27212pub struct SCALED_PRESSURE_DATA {
27213 #[doc = "Timestamp (time since system boot)."]
27214 pub time_boot_ms: u32,
27215 #[doc = "Absolute pressure"]
27216 pub press_abs: f32,
27217 #[doc = "Differential pressure 1"]
27218 pub press_diff: f32,
27219 #[doc = "Absolute pressure temperature"]
27220 pub temperature: i16,
27221 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27222 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27223 pub temperature_press_diff: i16,
27224}
27225impl SCALED_PRESSURE_DATA {
27226 pub const ENCODED_LEN: usize = 16usize;
27227 pub const DEFAULT: Self = Self {
27228 time_boot_ms: 0_u32,
27229 press_abs: 0.0_f32,
27230 press_diff: 0.0_f32,
27231 temperature: 0_i16,
27232 temperature_press_diff: 0_i16,
27233 };
27234 #[cfg(feature = "arbitrary")]
27235 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27236 use arbitrary::{Arbitrary, Unstructured};
27237 let mut buf = [0u8; 1024];
27238 rng.fill_bytes(&mut buf);
27239 let mut unstructured = Unstructured::new(&buf);
27240 Self::arbitrary(&mut unstructured).unwrap_or_default()
27241 }
27242}
27243impl Default for SCALED_PRESSURE_DATA {
27244 fn default() -> Self {
27245 Self::DEFAULT.clone()
27246 }
27247}
27248impl MessageData for SCALED_PRESSURE_DATA {
27249 type Message = MavMessage;
27250 const ID: u32 = 29u32;
27251 const NAME: &'static str = "SCALED_PRESSURE";
27252 const EXTRA_CRC: u8 = 115u8;
27253 const ENCODED_LEN: usize = 16usize;
27254 fn deser(
27255 _version: MavlinkVersion,
27256 __input: &[u8],
27257 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27258 let avail_len = __input.len();
27259 let mut payload_buf = [0; Self::ENCODED_LEN];
27260 let mut buf = if avail_len < Self::ENCODED_LEN {
27261 payload_buf[0..avail_len].copy_from_slice(__input);
27262 Bytes::new(&payload_buf)
27263 } else {
27264 Bytes::new(__input)
27265 };
27266 let mut __struct = Self::default();
27267 __struct.time_boot_ms = buf.get_u32_le();
27268 __struct.press_abs = buf.get_f32_le();
27269 __struct.press_diff = buf.get_f32_le();
27270 __struct.temperature = buf.get_i16_le();
27271 __struct.temperature_press_diff = buf.get_i16_le();
27272 Ok(__struct)
27273 }
27274 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27275 let mut __tmp = BytesMut::new(bytes);
27276 #[allow(clippy::absurd_extreme_comparisons)]
27277 #[allow(unused_comparisons)]
27278 if __tmp.remaining() < Self::ENCODED_LEN {
27279 panic!(
27280 "buffer is too small (need {} bytes, but got {})",
27281 Self::ENCODED_LEN,
27282 __tmp.remaining(),
27283 )
27284 }
27285 __tmp.put_u32_le(self.time_boot_ms);
27286 __tmp.put_f32_le(self.press_abs);
27287 __tmp.put_f32_le(self.press_diff);
27288 __tmp.put_i16_le(self.temperature);
27289 if matches!(version, MavlinkVersion::V2) {
27290 __tmp.put_i16_le(self.temperature_press_diff);
27291 let len = __tmp.len();
27292 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27293 } else {
27294 __tmp.len()
27295 }
27296 }
27297}
27298#[doc = "Barometer readings for 2nd barometer."]
27299#[doc = ""]
27300#[doc = "ID: 137"]
27301#[derive(Debug, Clone, PartialEq)]
27302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27304#[cfg_attr(feature = "ts", derive(TS))]
27305#[cfg_attr(feature = "ts", ts(export))]
27306pub struct SCALED_PRESSURE2_DATA {
27307 #[doc = "Timestamp (time since system boot)."]
27308 pub time_boot_ms: u32,
27309 #[doc = "Absolute pressure"]
27310 pub press_abs: f32,
27311 #[doc = "Differential pressure"]
27312 pub press_diff: f32,
27313 #[doc = "Absolute pressure temperature"]
27314 pub temperature: i16,
27315 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27316 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27317 pub temperature_press_diff: i16,
27318}
27319impl SCALED_PRESSURE2_DATA {
27320 pub const ENCODED_LEN: usize = 16usize;
27321 pub const DEFAULT: Self = Self {
27322 time_boot_ms: 0_u32,
27323 press_abs: 0.0_f32,
27324 press_diff: 0.0_f32,
27325 temperature: 0_i16,
27326 temperature_press_diff: 0_i16,
27327 };
27328 #[cfg(feature = "arbitrary")]
27329 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27330 use arbitrary::{Arbitrary, Unstructured};
27331 let mut buf = [0u8; 1024];
27332 rng.fill_bytes(&mut buf);
27333 let mut unstructured = Unstructured::new(&buf);
27334 Self::arbitrary(&mut unstructured).unwrap_or_default()
27335 }
27336}
27337impl Default for SCALED_PRESSURE2_DATA {
27338 fn default() -> Self {
27339 Self::DEFAULT.clone()
27340 }
27341}
27342impl MessageData for SCALED_PRESSURE2_DATA {
27343 type Message = MavMessage;
27344 const ID: u32 = 137u32;
27345 const NAME: &'static str = "SCALED_PRESSURE2";
27346 const EXTRA_CRC: u8 = 195u8;
27347 const ENCODED_LEN: usize = 16usize;
27348 fn deser(
27349 _version: MavlinkVersion,
27350 __input: &[u8],
27351 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27352 let avail_len = __input.len();
27353 let mut payload_buf = [0; Self::ENCODED_LEN];
27354 let mut buf = if avail_len < Self::ENCODED_LEN {
27355 payload_buf[0..avail_len].copy_from_slice(__input);
27356 Bytes::new(&payload_buf)
27357 } else {
27358 Bytes::new(__input)
27359 };
27360 let mut __struct = Self::default();
27361 __struct.time_boot_ms = buf.get_u32_le();
27362 __struct.press_abs = buf.get_f32_le();
27363 __struct.press_diff = buf.get_f32_le();
27364 __struct.temperature = buf.get_i16_le();
27365 __struct.temperature_press_diff = buf.get_i16_le();
27366 Ok(__struct)
27367 }
27368 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27369 let mut __tmp = BytesMut::new(bytes);
27370 #[allow(clippy::absurd_extreme_comparisons)]
27371 #[allow(unused_comparisons)]
27372 if __tmp.remaining() < Self::ENCODED_LEN {
27373 panic!(
27374 "buffer is too small (need {} bytes, but got {})",
27375 Self::ENCODED_LEN,
27376 __tmp.remaining(),
27377 )
27378 }
27379 __tmp.put_u32_le(self.time_boot_ms);
27380 __tmp.put_f32_le(self.press_abs);
27381 __tmp.put_f32_le(self.press_diff);
27382 __tmp.put_i16_le(self.temperature);
27383 if matches!(version, MavlinkVersion::V2) {
27384 __tmp.put_i16_le(self.temperature_press_diff);
27385 let len = __tmp.len();
27386 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27387 } else {
27388 __tmp.len()
27389 }
27390 }
27391}
27392#[doc = "Barometer readings for 3rd barometer."]
27393#[doc = ""]
27394#[doc = "ID: 143"]
27395#[derive(Debug, Clone, PartialEq)]
27396#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27397#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27398#[cfg_attr(feature = "ts", derive(TS))]
27399#[cfg_attr(feature = "ts", ts(export))]
27400pub struct SCALED_PRESSURE3_DATA {
27401 #[doc = "Timestamp (time since system boot)."]
27402 pub time_boot_ms: u32,
27403 #[doc = "Absolute pressure"]
27404 pub press_abs: f32,
27405 #[doc = "Differential pressure"]
27406 pub press_diff: f32,
27407 #[doc = "Absolute pressure temperature"]
27408 pub temperature: i16,
27409 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27410 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27411 pub temperature_press_diff: i16,
27412}
27413impl SCALED_PRESSURE3_DATA {
27414 pub const ENCODED_LEN: usize = 16usize;
27415 pub const DEFAULT: Self = Self {
27416 time_boot_ms: 0_u32,
27417 press_abs: 0.0_f32,
27418 press_diff: 0.0_f32,
27419 temperature: 0_i16,
27420 temperature_press_diff: 0_i16,
27421 };
27422 #[cfg(feature = "arbitrary")]
27423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27424 use arbitrary::{Arbitrary, Unstructured};
27425 let mut buf = [0u8; 1024];
27426 rng.fill_bytes(&mut buf);
27427 let mut unstructured = Unstructured::new(&buf);
27428 Self::arbitrary(&mut unstructured).unwrap_or_default()
27429 }
27430}
27431impl Default for SCALED_PRESSURE3_DATA {
27432 fn default() -> Self {
27433 Self::DEFAULT.clone()
27434 }
27435}
27436impl MessageData for SCALED_PRESSURE3_DATA {
27437 type Message = MavMessage;
27438 const ID: u32 = 143u32;
27439 const NAME: &'static str = "SCALED_PRESSURE3";
27440 const EXTRA_CRC: u8 = 131u8;
27441 const ENCODED_LEN: usize = 16usize;
27442 fn deser(
27443 _version: MavlinkVersion,
27444 __input: &[u8],
27445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27446 let avail_len = __input.len();
27447 let mut payload_buf = [0; Self::ENCODED_LEN];
27448 let mut buf = if avail_len < Self::ENCODED_LEN {
27449 payload_buf[0..avail_len].copy_from_slice(__input);
27450 Bytes::new(&payload_buf)
27451 } else {
27452 Bytes::new(__input)
27453 };
27454 let mut __struct = Self::default();
27455 __struct.time_boot_ms = buf.get_u32_le();
27456 __struct.press_abs = buf.get_f32_le();
27457 __struct.press_diff = buf.get_f32_le();
27458 __struct.temperature = buf.get_i16_le();
27459 __struct.temperature_press_diff = buf.get_i16_le();
27460 Ok(__struct)
27461 }
27462 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27463 let mut __tmp = BytesMut::new(bytes);
27464 #[allow(clippy::absurd_extreme_comparisons)]
27465 #[allow(unused_comparisons)]
27466 if __tmp.remaining() < Self::ENCODED_LEN {
27467 panic!(
27468 "buffer is too small (need {} bytes, but got {})",
27469 Self::ENCODED_LEN,
27470 __tmp.remaining(),
27471 )
27472 }
27473 __tmp.put_u32_le(self.time_boot_ms);
27474 __tmp.put_f32_le(self.press_abs);
27475 __tmp.put_f32_le(self.press_diff);
27476 __tmp.put_i16_le(self.temperature);
27477 if matches!(version, MavlinkVersion::V2) {
27478 __tmp.put_i16_le(self.temperature_press_diff);
27479 let len = __tmp.len();
27480 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27481 } else {
27482 __tmp.len()
27483 }
27484 }
27485}
27486#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27487#[doc = ""]
27488#[doc = "ID: 126"]
27489#[derive(Debug, Clone, PartialEq)]
27490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27492#[cfg_attr(feature = "ts", derive(TS))]
27493#[cfg_attr(feature = "ts", ts(export))]
27494pub struct SERIAL_CONTROL_DATA {
27495 #[doc = "Baudrate of transfer. Zero means no change."]
27496 pub baudrate: u32,
27497 #[doc = "Timeout for reply data"]
27498 pub timeout: u16,
27499 #[doc = "Serial control device type."]
27500 pub device: SerialControlDev,
27501 #[doc = "Bitmap of serial control flags."]
27502 pub flags: SerialControlFlag,
27503 #[doc = "how many bytes in this transfer"]
27504 pub count: u8,
27505 #[doc = "serial data"]
27506 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27507 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27508 pub data: [u8; 70],
27509 #[doc = "System ID"]
27510 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27511 pub target_system: u8,
27512 #[doc = "Component ID"]
27513 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27514 pub target_component: u8,
27515}
27516impl SERIAL_CONTROL_DATA {
27517 pub const ENCODED_LEN: usize = 81usize;
27518 pub const DEFAULT: Self = Self {
27519 baudrate: 0_u32,
27520 timeout: 0_u16,
27521 device: SerialControlDev::DEFAULT,
27522 flags: SerialControlFlag::DEFAULT,
27523 count: 0_u8,
27524 data: [0_u8; 70usize],
27525 target_system: 0_u8,
27526 target_component: 0_u8,
27527 };
27528 #[cfg(feature = "arbitrary")]
27529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27530 use arbitrary::{Arbitrary, Unstructured};
27531 let mut buf = [0u8; 1024];
27532 rng.fill_bytes(&mut buf);
27533 let mut unstructured = Unstructured::new(&buf);
27534 Self::arbitrary(&mut unstructured).unwrap_or_default()
27535 }
27536}
27537impl Default for SERIAL_CONTROL_DATA {
27538 fn default() -> Self {
27539 Self::DEFAULT.clone()
27540 }
27541}
27542impl MessageData for SERIAL_CONTROL_DATA {
27543 type Message = MavMessage;
27544 const ID: u32 = 126u32;
27545 const NAME: &'static str = "SERIAL_CONTROL";
27546 const EXTRA_CRC: u8 = 220u8;
27547 const ENCODED_LEN: usize = 81usize;
27548 fn deser(
27549 _version: MavlinkVersion,
27550 __input: &[u8],
27551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27552 let avail_len = __input.len();
27553 let mut payload_buf = [0; Self::ENCODED_LEN];
27554 let mut buf = if avail_len < Self::ENCODED_LEN {
27555 payload_buf[0..avail_len].copy_from_slice(__input);
27556 Bytes::new(&payload_buf)
27557 } else {
27558 Bytes::new(__input)
27559 };
27560 let mut __struct = Self::default();
27561 __struct.baudrate = buf.get_u32_le();
27562 __struct.timeout = buf.get_u16_le();
27563 let tmp = buf.get_u8();
27564 __struct.device =
27565 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27566 enum_type: "SerialControlDev",
27567 value: tmp as u32,
27568 })?;
27569 let tmp = buf.get_u8();
27570 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
27571 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27572 flag_type: "SerialControlFlag",
27573 value: tmp as u32,
27574 })?;
27575 __struct.count = buf.get_u8();
27576 for v in &mut __struct.data {
27577 let val = buf.get_u8();
27578 *v = val;
27579 }
27580 __struct.target_system = buf.get_u8();
27581 __struct.target_component = buf.get_u8();
27582 Ok(__struct)
27583 }
27584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27585 let mut __tmp = BytesMut::new(bytes);
27586 #[allow(clippy::absurd_extreme_comparisons)]
27587 #[allow(unused_comparisons)]
27588 if __tmp.remaining() < Self::ENCODED_LEN {
27589 panic!(
27590 "buffer is too small (need {} bytes, but got {})",
27591 Self::ENCODED_LEN,
27592 __tmp.remaining(),
27593 )
27594 }
27595 __tmp.put_u32_le(self.baudrate);
27596 __tmp.put_u16_le(self.timeout);
27597 __tmp.put_u8(self.device as u8);
27598 __tmp.put_u8(self.flags.bits());
27599 __tmp.put_u8(self.count);
27600 for val in &self.data {
27601 __tmp.put_u8(*val);
27602 }
27603 if matches!(version, MavlinkVersion::V2) {
27604 __tmp.put_u8(self.target_system);
27605 __tmp.put_u8(self.target_component);
27606 let len = __tmp.len();
27607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27608 } else {
27609 __tmp.len()
27610 }
27611 }
27612}
27613#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27614#[doc = ""]
27615#[doc = "ID: 36"]
27616#[derive(Debug, Clone, PartialEq)]
27617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27619#[cfg_attr(feature = "ts", derive(TS))]
27620#[cfg_attr(feature = "ts", ts(export))]
27621pub struct SERVO_OUTPUT_RAW_DATA {
27622 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27623 pub time_usec: u32,
27624 #[doc = "Servo output 1 value"]
27625 pub servo1_raw: u16,
27626 #[doc = "Servo output 2 value"]
27627 pub servo2_raw: u16,
27628 #[doc = "Servo output 3 value"]
27629 pub servo3_raw: u16,
27630 #[doc = "Servo output 4 value"]
27631 pub servo4_raw: u16,
27632 #[doc = "Servo output 5 value"]
27633 pub servo5_raw: u16,
27634 #[doc = "Servo output 6 value"]
27635 pub servo6_raw: u16,
27636 #[doc = "Servo output 7 value"]
27637 pub servo7_raw: u16,
27638 #[doc = "Servo output 8 value"]
27639 pub servo8_raw: u16,
27640 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27641 pub port: u8,
27642 #[doc = "Servo output 9 value"]
27643 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27644 pub servo9_raw: u16,
27645 #[doc = "Servo output 10 value"]
27646 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27647 pub servo10_raw: u16,
27648 #[doc = "Servo output 11 value"]
27649 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27650 pub servo11_raw: u16,
27651 #[doc = "Servo output 12 value"]
27652 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27653 pub servo12_raw: u16,
27654 #[doc = "Servo output 13 value"]
27655 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27656 pub servo13_raw: u16,
27657 #[doc = "Servo output 14 value"]
27658 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27659 pub servo14_raw: u16,
27660 #[doc = "Servo output 15 value"]
27661 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27662 pub servo15_raw: u16,
27663 #[doc = "Servo output 16 value"]
27664 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27665 pub servo16_raw: u16,
27666}
27667impl SERVO_OUTPUT_RAW_DATA {
27668 pub const ENCODED_LEN: usize = 37usize;
27669 pub const DEFAULT: Self = Self {
27670 time_usec: 0_u32,
27671 servo1_raw: 0_u16,
27672 servo2_raw: 0_u16,
27673 servo3_raw: 0_u16,
27674 servo4_raw: 0_u16,
27675 servo5_raw: 0_u16,
27676 servo6_raw: 0_u16,
27677 servo7_raw: 0_u16,
27678 servo8_raw: 0_u16,
27679 port: 0_u8,
27680 servo9_raw: 0_u16,
27681 servo10_raw: 0_u16,
27682 servo11_raw: 0_u16,
27683 servo12_raw: 0_u16,
27684 servo13_raw: 0_u16,
27685 servo14_raw: 0_u16,
27686 servo15_raw: 0_u16,
27687 servo16_raw: 0_u16,
27688 };
27689 #[cfg(feature = "arbitrary")]
27690 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27691 use arbitrary::{Arbitrary, Unstructured};
27692 let mut buf = [0u8; 1024];
27693 rng.fill_bytes(&mut buf);
27694 let mut unstructured = Unstructured::new(&buf);
27695 Self::arbitrary(&mut unstructured).unwrap_or_default()
27696 }
27697}
27698impl Default for SERVO_OUTPUT_RAW_DATA {
27699 fn default() -> Self {
27700 Self::DEFAULT.clone()
27701 }
27702}
27703impl MessageData for SERVO_OUTPUT_RAW_DATA {
27704 type Message = MavMessage;
27705 const ID: u32 = 36u32;
27706 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27707 const EXTRA_CRC: u8 = 222u8;
27708 const ENCODED_LEN: usize = 37usize;
27709 fn deser(
27710 _version: MavlinkVersion,
27711 __input: &[u8],
27712 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27713 let avail_len = __input.len();
27714 let mut payload_buf = [0; Self::ENCODED_LEN];
27715 let mut buf = if avail_len < Self::ENCODED_LEN {
27716 payload_buf[0..avail_len].copy_from_slice(__input);
27717 Bytes::new(&payload_buf)
27718 } else {
27719 Bytes::new(__input)
27720 };
27721 let mut __struct = Self::default();
27722 __struct.time_usec = buf.get_u32_le();
27723 __struct.servo1_raw = buf.get_u16_le();
27724 __struct.servo2_raw = buf.get_u16_le();
27725 __struct.servo3_raw = buf.get_u16_le();
27726 __struct.servo4_raw = buf.get_u16_le();
27727 __struct.servo5_raw = buf.get_u16_le();
27728 __struct.servo6_raw = buf.get_u16_le();
27729 __struct.servo7_raw = buf.get_u16_le();
27730 __struct.servo8_raw = buf.get_u16_le();
27731 __struct.port = buf.get_u8();
27732 __struct.servo9_raw = buf.get_u16_le();
27733 __struct.servo10_raw = buf.get_u16_le();
27734 __struct.servo11_raw = buf.get_u16_le();
27735 __struct.servo12_raw = buf.get_u16_le();
27736 __struct.servo13_raw = buf.get_u16_le();
27737 __struct.servo14_raw = buf.get_u16_le();
27738 __struct.servo15_raw = buf.get_u16_le();
27739 __struct.servo16_raw = buf.get_u16_le();
27740 Ok(__struct)
27741 }
27742 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27743 let mut __tmp = BytesMut::new(bytes);
27744 #[allow(clippy::absurd_extreme_comparisons)]
27745 #[allow(unused_comparisons)]
27746 if __tmp.remaining() < Self::ENCODED_LEN {
27747 panic!(
27748 "buffer is too small (need {} bytes, but got {})",
27749 Self::ENCODED_LEN,
27750 __tmp.remaining(),
27751 )
27752 }
27753 __tmp.put_u32_le(self.time_usec);
27754 __tmp.put_u16_le(self.servo1_raw);
27755 __tmp.put_u16_le(self.servo2_raw);
27756 __tmp.put_u16_le(self.servo3_raw);
27757 __tmp.put_u16_le(self.servo4_raw);
27758 __tmp.put_u16_le(self.servo5_raw);
27759 __tmp.put_u16_le(self.servo6_raw);
27760 __tmp.put_u16_le(self.servo7_raw);
27761 __tmp.put_u16_le(self.servo8_raw);
27762 __tmp.put_u8(self.port);
27763 if matches!(version, MavlinkVersion::V2) {
27764 __tmp.put_u16_le(self.servo9_raw);
27765 __tmp.put_u16_le(self.servo10_raw);
27766 __tmp.put_u16_le(self.servo11_raw);
27767 __tmp.put_u16_le(self.servo12_raw);
27768 __tmp.put_u16_le(self.servo13_raw);
27769 __tmp.put_u16_le(self.servo14_raw);
27770 __tmp.put_u16_le(self.servo15_raw);
27771 __tmp.put_u16_le(self.servo16_raw);
27772 let len = __tmp.len();
27773 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27774 } else {
27775 __tmp.len()
27776 }
27777 }
27778}
27779#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27780#[doc = ""]
27781#[doc = "ID: 256"]
27782#[derive(Debug, Clone, PartialEq)]
27783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27785#[cfg_attr(feature = "ts", derive(TS))]
27786#[cfg_attr(feature = "ts", ts(export))]
27787pub struct SETUP_SIGNING_DATA {
27788 #[doc = "initial timestamp"]
27789 pub initial_timestamp: u64,
27790 #[doc = "system id of the target"]
27791 pub target_system: u8,
27792 #[doc = "component ID of the target"]
27793 pub target_component: u8,
27794 #[doc = "signing key"]
27795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27796 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27797 pub secret_key: [u8; 32],
27798}
27799impl SETUP_SIGNING_DATA {
27800 pub const ENCODED_LEN: usize = 42usize;
27801 pub const DEFAULT: Self = Self {
27802 initial_timestamp: 0_u64,
27803 target_system: 0_u8,
27804 target_component: 0_u8,
27805 secret_key: [0_u8; 32usize],
27806 };
27807 #[cfg(feature = "arbitrary")]
27808 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27809 use arbitrary::{Arbitrary, Unstructured};
27810 let mut buf = [0u8; 1024];
27811 rng.fill_bytes(&mut buf);
27812 let mut unstructured = Unstructured::new(&buf);
27813 Self::arbitrary(&mut unstructured).unwrap_or_default()
27814 }
27815}
27816impl Default for SETUP_SIGNING_DATA {
27817 fn default() -> Self {
27818 Self::DEFAULT.clone()
27819 }
27820}
27821impl MessageData for SETUP_SIGNING_DATA {
27822 type Message = MavMessage;
27823 const ID: u32 = 256u32;
27824 const NAME: &'static str = "SETUP_SIGNING";
27825 const EXTRA_CRC: u8 = 71u8;
27826 const ENCODED_LEN: usize = 42usize;
27827 fn deser(
27828 _version: MavlinkVersion,
27829 __input: &[u8],
27830 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27831 let avail_len = __input.len();
27832 let mut payload_buf = [0; Self::ENCODED_LEN];
27833 let mut buf = if avail_len < Self::ENCODED_LEN {
27834 payload_buf[0..avail_len].copy_from_slice(__input);
27835 Bytes::new(&payload_buf)
27836 } else {
27837 Bytes::new(__input)
27838 };
27839 let mut __struct = Self::default();
27840 __struct.initial_timestamp = buf.get_u64_le();
27841 __struct.target_system = buf.get_u8();
27842 __struct.target_component = buf.get_u8();
27843 for v in &mut __struct.secret_key {
27844 let val = buf.get_u8();
27845 *v = val;
27846 }
27847 Ok(__struct)
27848 }
27849 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27850 let mut __tmp = BytesMut::new(bytes);
27851 #[allow(clippy::absurd_extreme_comparisons)]
27852 #[allow(unused_comparisons)]
27853 if __tmp.remaining() < Self::ENCODED_LEN {
27854 panic!(
27855 "buffer is too small (need {} bytes, but got {})",
27856 Self::ENCODED_LEN,
27857 __tmp.remaining(),
27858 )
27859 }
27860 __tmp.put_u64_le(self.initial_timestamp);
27861 __tmp.put_u8(self.target_system);
27862 __tmp.put_u8(self.target_component);
27863 for val in &self.secret_key {
27864 __tmp.put_u8(*val);
27865 }
27866 if matches!(version, MavlinkVersion::V2) {
27867 let len = __tmp.len();
27868 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27869 } else {
27870 __tmp.len()
27871 }
27872 }
27873}
27874#[doc = "Set the vehicle attitude and body angular rates."]
27875#[doc = ""]
27876#[doc = "ID: 139"]
27877#[derive(Debug, Clone, PartialEq)]
27878#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27879#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27880#[cfg_attr(feature = "ts", derive(TS))]
27881#[cfg_attr(feature = "ts", ts(export))]
27882pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27883 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27884 pub time_usec: u64,
27885 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27886 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27887 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27888 pub controls: [f32; 8],
27889 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27890 pub group_mlx: u8,
27891 #[doc = "System ID"]
27892 pub target_system: u8,
27893 #[doc = "Component ID"]
27894 pub target_component: u8,
27895}
27896impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27897 pub const ENCODED_LEN: usize = 43usize;
27898 pub const DEFAULT: Self = Self {
27899 time_usec: 0_u64,
27900 controls: [0.0_f32; 8usize],
27901 group_mlx: 0_u8,
27902 target_system: 0_u8,
27903 target_component: 0_u8,
27904 };
27905 #[cfg(feature = "arbitrary")]
27906 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27907 use arbitrary::{Arbitrary, Unstructured};
27908 let mut buf = [0u8; 1024];
27909 rng.fill_bytes(&mut buf);
27910 let mut unstructured = Unstructured::new(&buf);
27911 Self::arbitrary(&mut unstructured).unwrap_or_default()
27912 }
27913}
27914impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27915 fn default() -> Self {
27916 Self::DEFAULT.clone()
27917 }
27918}
27919impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27920 type Message = MavMessage;
27921 const ID: u32 = 139u32;
27922 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27923 const EXTRA_CRC: u8 = 168u8;
27924 const ENCODED_LEN: usize = 43usize;
27925 fn deser(
27926 _version: MavlinkVersion,
27927 __input: &[u8],
27928 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27929 let avail_len = __input.len();
27930 let mut payload_buf = [0; Self::ENCODED_LEN];
27931 let mut buf = if avail_len < Self::ENCODED_LEN {
27932 payload_buf[0..avail_len].copy_from_slice(__input);
27933 Bytes::new(&payload_buf)
27934 } else {
27935 Bytes::new(__input)
27936 };
27937 let mut __struct = Self::default();
27938 __struct.time_usec = buf.get_u64_le();
27939 for v in &mut __struct.controls {
27940 let val = buf.get_f32_le();
27941 *v = val;
27942 }
27943 __struct.group_mlx = buf.get_u8();
27944 __struct.target_system = buf.get_u8();
27945 __struct.target_component = buf.get_u8();
27946 Ok(__struct)
27947 }
27948 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27949 let mut __tmp = BytesMut::new(bytes);
27950 #[allow(clippy::absurd_extreme_comparisons)]
27951 #[allow(unused_comparisons)]
27952 if __tmp.remaining() < Self::ENCODED_LEN {
27953 panic!(
27954 "buffer is too small (need {} bytes, but got {})",
27955 Self::ENCODED_LEN,
27956 __tmp.remaining(),
27957 )
27958 }
27959 __tmp.put_u64_le(self.time_usec);
27960 for val in &self.controls {
27961 __tmp.put_f32_le(*val);
27962 }
27963 __tmp.put_u8(self.group_mlx);
27964 __tmp.put_u8(self.target_system);
27965 __tmp.put_u8(self.target_component);
27966 if matches!(version, MavlinkVersion::V2) {
27967 let len = __tmp.len();
27968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27969 } else {
27970 __tmp.len()
27971 }
27972 }
27973}
27974#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27975#[doc = ""]
27976#[doc = "ID: 82"]
27977#[derive(Debug, Clone, PartialEq)]
27978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27980#[cfg_attr(feature = "ts", derive(TS))]
27981#[cfg_attr(feature = "ts", ts(export))]
27982pub struct SET_ATTITUDE_TARGET_DATA {
27983 #[doc = "Timestamp (time since system boot)."]
27984 pub time_boot_ms: u32,
27985 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27986 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27987 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27988 pub q: [f32; 4],
27989 #[doc = "Body roll rate"]
27990 pub body_roll_rate: f32,
27991 #[doc = "Body pitch rate"]
27992 pub body_pitch_rate: f32,
27993 #[doc = "Body yaw rate"]
27994 pub body_yaw_rate: f32,
27995 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27996 pub thrust: f32,
27997 #[doc = "System ID"]
27998 pub target_system: u8,
27999 #[doc = "Component ID"]
28000 pub target_component: u8,
28001 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28002 pub type_mask: AttitudeTargetTypemask,
28003 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
28004 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28005 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28006 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28007 pub thrust_body: [f32; 3],
28008}
28009impl SET_ATTITUDE_TARGET_DATA {
28010 pub const ENCODED_LEN: usize = 51usize;
28011 pub const DEFAULT: Self = Self {
28012 time_boot_ms: 0_u32,
28013 q: [0.0_f32; 4usize],
28014 body_roll_rate: 0.0_f32,
28015 body_pitch_rate: 0.0_f32,
28016 body_yaw_rate: 0.0_f32,
28017 thrust: 0.0_f32,
28018 target_system: 0_u8,
28019 target_component: 0_u8,
28020 type_mask: AttitudeTargetTypemask::DEFAULT,
28021 thrust_body: [0.0_f32; 3usize],
28022 };
28023 #[cfg(feature = "arbitrary")]
28024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28025 use arbitrary::{Arbitrary, Unstructured};
28026 let mut buf = [0u8; 1024];
28027 rng.fill_bytes(&mut buf);
28028 let mut unstructured = Unstructured::new(&buf);
28029 Self::arbitrary(&mut unstructured).unwrap_or_default()
28030 }
28031}
28032impl Default for SET_ATTITUDE_TARGET_DATA {
28033 fn default() -> Self {
28034 Self::DEFAULT.clone()
28035 }
28036}
28037impl MessageData for SET_ATTITUDE_TARGET_DATA {
28038 type Message = MavMessage;
28039 const ID: u32 = 82u32;
28040 const NAME: &'static str = "SET_ATTITUDE_TARGET";
28041 const EXTRA_CRC: u8 = 49u8;
28042 const ENCODED_LEN: usize = 51usize;
28043 fn deser(
28044 _version: MavlinkVersion,
28045 __input: &[u8],
28046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28047 let avail_len = __input.len();
28048 let mut payload_buf = [0; Self::ENCODED_LEN];
28049 let mut buf = if avail_len < Self::ENCODED_LEN {
28050 payload_buf[0..avail_len].copy_from_slice(__input);
28051 Bytes::new(&payload_buf)
28052 } else {
28053 Bytes::new(__input)
28054 };
28055 let mut __struct = Self::default();
28056 __struct.time_boot_ms = buf.get_u32_le();
28057 for v in &mut __struct.q {
28058 let val = buf.get_f32_le();
28059 *v = val;
28060 }
28061 __struct.body_roll_rate = buf.get_f32_le();
28062 __struct.body_pitch_rate = buf.get_f32_le();
28063 __struct.body_yaw_rate = buf.get_f32_le();
28064 __struct.thrust = buf.get_f32_le();
28065 __struct.target_system = buf.get_u8();
28066 __struct.target_component = buf.get_u8();
28067 let tmp = buf.get_u8();
28068 __struct.type_mask = AttitudeTargetTypemask::from_bits(
28069 tmp & AttitudeTargetTypemask::all().bits(),
28070 )
28071 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28072 flag_type: "AttitudeTargetTypemask",
28073 value: tmp as u32,
28074 })?;
28075 for v in &mut __struct.thrust_body {
28076 let val = buf.get_f32_le();
28077 *v = val;
28078 }
28079 Ok(__struct)
28080 }
28081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28082 let mut __tmp = BytesMut::new(bytes);
28083 #[allow(clippy::absurd_extreme_comparisons)]
28084 #[allow(unused_comparisons)]
28085 if __tmp.remaining() < Self::ENCODED_LEN {
28086 panic!(
28087 "buffer is too small (need {} bytes, but got {})",
28088 Self::ENCODED_LEN,
28089 __tmp.remaining(),
28090 )
28091 }
28092 __tmp.put_u32_le(self.time_boot_ms);
28093 for val in &self.q {
28094 __tmp.put_f32_le(*val);
28095 }
28096 __tmp.put_f32_le(self.body_roll_rate);
28097 __tmp.put_f32_le(self.body_pitch_rate);
28098 __tmp.put_f32_le(self.body_yaw_rate);
28099 __tmp.put_f32_le(self.thrust);
28100 __tmp.put_u8(self.target_system);
28101 __tmp.put_u8(self.target_component);
28102 __tmp.put_u8(self.type_mask.bits());
28103 if matches!(version, MavlinkVersion::V2) {
28104 for val in &self.thrust_body {
28105 __tmp.put_f32_le(*val);
28106 }
28107 let len = __tmp.len();
28108 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28109 } else {
28110 __tmp.len()
28111 }
28112 }
28113}
28114#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
28115#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
28116#[doc = ""]
28117#[doc = "ID: 48"]
28118#[derive(Debug, Clone, PartialEq)]
28119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28121#[cfg_attr(feature = "ts", derive(TS))]
28122#[cfg_attr(feature = "ts", ts(export))]
28123pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
28124 #[doc = "Latitude (WGS84)"]
28125 pub latitude: i32,
28126 #[doc = "Longitude (WGS84)"]
28127 pub longitude: i32,
28128 #[doc = "Altitude (MSL). Positive for up."]
28129 pub altitude: i32,
28130 #[doc = "System ID"]
28131 pub target_system: u8,
28132 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28133 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28134 pub time_usec: u64,
28135}
28136impl SET_GPS_GLOBAL_ORIGIN_DATA {
28137 pub const ENCODED_LEN: usize = 21usize;
28138 pub const DEFAULT: Self = Self {
28139 latitude: 0_i32,
28140 longitude: 0_i32,
28141 altitude: 0_i32,
28142 target_system: 0_u8,
28143 time_usec: 0_u64,
28144 };
28145 #[cfg(feature = "arbitrary")]
28146 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28147 use arbitrary::{Arbitrary, Unstructured};
28148 let mut buf = [0u8; 1024];
28149 rng.fill_bytes(&mut buf);
28150 let mut unstructured = Unstructured::new(&buf);
28151 Self::arbitrary(&mut unstructured).unwrap_or_default()
28152 }
28153}
28154impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28155 fn default() -> Self {
28156 Self::DEFAULT.clone()
28157 }
28158}
28159impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28160 type Message = MavMessage;
28161 const ID: u32 = 48u32;
28162 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28163 const EXTRA_CRC: u8 = 41u8;
28164 const ENCODED_LEN: usize = 21usize;
28165 fn deser(
28166 _version: MavlinkVersion,
28167 __input: &[u8],
28168 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28169 let avail_len = __input.len();
28170 let mut payload_buf = [0; Self::ENCODED_LEN];
28171 let mut buf = if avail_len < Self::ENCODED_LEN {
28172 payload_buf[0..avail_len].copy_from_slice(__input);
28173 Bytes::new(&payload_buf)
28174 } else {
28175 Bytes::new(__input)
28176 };
28177 let mut __struct = Self::default();
28178 __struct.latitude = buf.get_i32_le();
28179 __struct.longitude = buf.get_i32_le();
28180 __struct.altitude = buf.get_i32_le();
28181 __struct.target_system = buf.get_u8();
28182 __struct.time_usec = buf.get_u64_le();
28183 Ok(__struct)
28184 }
28185 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28186 let mut __tmp = BytesMut::new(bytes);
28187 #[allow(clippy::absurd_extreme_comparisons)]
28188 #[allow(unused_comparisons)]
28189 if __tmp.remaining() < Self::ENCODED_LEN {
28190 panic!(
28191 "buffer is too small (need {} bytes, but got {})",
28192 Self::ENCODED_LEN,
28193 __tmp.remaining(),
28194 )
28195 }
28196 __tmp.put_i32_le(self.latitude);
28197 __tmp.put_i32_le(self.longitude);
28198 __tmp.put_i32_le(self.altitude);
28199 __tmp.put_u8(self.target_system);
28200 if matches!(version, MavlinkVersion::V2) {
28201 __tmp.put_u64_le(self.time_usec);
28202 let len = __tmp.len();
28203 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28204 } else {
28205 __tmp.len()
28206 }
28207 }
28208}
28209#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28210#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28211#[doc = ""]
28212#[doc = "ID: 243"]
28213#[derive(Debug, Clone, PartialEq)]
28214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28216#[cfg_attr(feature = "ts", derive(TS))]
28217#[cfg_attr(feature = "ts", ts(export))]
28218pub struct SET_HOME_POSITION_DATA {
28219 #[doc = "Latitude (WGS84)"]
28220 pub latitude: i32,
28221 #[doc = "Longitude (WGS84)"]
28222 pub longitude: i32,
28223 #[doc = "Altitude (MSL). Positive for up."]
28224 pub altitude: i32,
28225 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28226 pub x: f32,
28227 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28228 pub y: f32,
28229 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28230 pub z: f32,
28231 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28232 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28233 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28234 pub q: [f32; 4],
28235 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28236 pub approach_x: f32,
28237 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28238 pub approach_y: f32,
28239 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28240 pub approach_z: f32,
28241 #[doc = "System ID."]
28242 pub target_system: u8,
28243 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28244 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28245 pub time_usec: u64,
28246}
28247impl SET_HOME_POSITION_DATA {
28248 pub const ENCODED_LEN: usize = 61usize;
28249 pub const DEFAULT: Self = Self {
28250 latitude: 0_i32,
28251 longitude: 0_i32,
28252 altitude: 0_i32,
28253 x: 0.0_f32,
28254 y: 0.0_f32,
28255 z: 0.0_f32,
28256 q: [0.0_f32; 4usize],
28257 approach_x: 0.0_f32,
28258 approach_y: 0.0_f32,
28259 approach_z: 0.0_f32,
28260 target_system: 0_u8,
28261 time_usec: 0_u64,
28262 };
28263 #[cfg(feature = "arbitrary")]
28264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28265 use arbitrary::{Arbitrary, Unstructured};
28266 let mut buf = [0u8; 1024];
28267 rng.fill_bytes(&mut buf);
28268 let mut unstructured = Unstructured::new(&buf);
28269 Self::arbitrary(&mut unstructured).unwrap_or_default()
28270 }
28271}
28272impl Default for SET_HOME_POSITION_DATA {
28273 fn default() -> Self {
28274 Self::DEFAULT.clone()
28275 }
28276}
28277impl MessageData for SET_HOME_POSITION_DATA {
28278 type Message = MavMessage;
28279 const ID: u32 = 243u32;
28280 const NAME: &'static str = "SET_HOME_POSITION";
28281 const EXTRA_CRC: u8 = 85u8;
28282 const ENCODED_LEN: usize = 61usize;
28283 fn deser(
28284 _version: MavlinkVersion,
28285 __input: &[u8],
28286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28287 let avail_len = __input.len();
28288 let mut payload_buf = [0; Self::ENCODED_LEN];
28289 let mut buf = if avail_len < Self::ENCODED_LEN {
28290 payload_buf[0..avail_len].copy_from_slice(__input);
28291 Bytes::new(&payload_buf)
28292 } else {
28293 Bytes::new(__input)
28294 };
28295 let mut __struct = Self::default();
28296 __struct.latitude = buf.get_i32_le();
28297 __struct.longitude = buf.get_i32_le();
28298 __struct.altitude = buf.get_i32_le();
28299 __struct.x = buf.get_f32_le();
28300 __struct.y = buf.get_f32_le();
28301 __struct.z = buf.get_f32_le();
28302 for v in &mut __struct.q {
28303 let val = buf.get_f32_le();
28304 *v = val;
28305 }
28306 __struct.approach_x = buf.get_f32_le();
28307 __struct.approach_y = buf.get_f32_le();
28308 __struct.approach_z = buf.get_f32_le();
28309 __struct.target_system = buf.get_u8();
28310 __struct.time_usec = buf.get_u64_le();
28311 Ok(__struct)
28312 }
28313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28314 let mut __tmp = BytesMut::new(bytes);
28315 #[allow(clippy::absurd_extreme_comparisons)]
28316 #[allow(unused_comparisons)]
28317 if __tmp.remaining() < Self::ENCODED_LEN {
28318 panic!(
28319 "buffer is too small (need {} bytes, but got {})",
28320 Self::ENCODED_LEN,
28321 __tmp.remaining(),
28322 )
28323 }
28324 __tmp.put_i32_le(self.latitude);
28325 __tmp.put_i32_le(self.longitude);
28326 __tmp.put_i32_le(self.altitude);
28327 __tmp.put_f32_le(self.x);
28328 __tmp.put_f32_le(self.y);
28329 __tmp.put_f32_le(self.z);
28330 for val in &self.q {
28331 __tmp.put_f32_le(*val);
28332 }
28333 __tmp.put_f32_le(self.approach_x);
28334 __tmp.put_f32_le(self.approach_y);
28335 __tmp.put_f32_le(self.approach_z);
28336 __tmp.put_u8(self.target_system);
28337 if matches!(version, MavlinkVersion::V2) {
28338 __tmp.put_u64_le(self.time_usec);
28339 let len = __tmp.len();
28340 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28341 } else {
28342 __tmp.len()
28343 }
28344 }
28345}
28346#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28347#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28348#[doc = ""]
28349#[doc = "ID: 11"]
28350#[derive(Debug, Clone, PartialEq)]
28351#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28352#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28353#[cfg_attr(feature = "ts", derive(TS))]
28354#[cfg_attr(feature = "ts", ts(export))]
28355pub struct SET_MODE_DATA {
28356 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28357 pub custom_mode: u32,
28358 #[doc = "The system setting the mode"]
28359 pub target_system: u8,
28360 #[doc = "The new base mode."]
28361 pub base_mode: MavMode,
28362}
28363impl SET_MODE_DATA {
28364 pub const ENCODED_LEN: usize = 6usize;
28365 pub const DEFAULT: Self = Self {
28366 custom_mode: 0_u32,
28367 target_system: 0_u8,
28368 base_mode: MavMode::DEFAULT,
28369 };
28370 #[cfg(feature = "arbitrary")]
28371 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28372 use arbitrary::{Arbitrary, Unstructured};
28373 let mut buf = [0u8; 1024];
28374 rng.fill_bytes(&mut buf);
28375 let mut unstructured = Unstructured::new(&buf);
28376 Self::arbitrary(&mut unstructured).unwrap_or_default()
28377 }
28378}
28379impl Default for SET_MODE_DATA {
28380 fn default() -> Self {
28381 Self::DEFAULT.clone()
28382 }
28383}
28384impl MessageData for SET_MODE_DATA {
28385 type Message = MavMessage;
28386 const ID: u32 = 11u32;
28387 const NAME: &'static str = "SET_MODE";
28388 const EXTRA_CRC: u8 = 89u8;
28389 const ENCODED_LEN: usize = 6usize;
28390 fn deser(
28391 _version: MavlinkVersion,
28392 __input: &[u8],
28393 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28394 let avail_len = __input.len();
28395 let mut payload_buf = [0; Self::ENCODED_LEN];
28396 let mut buf = if avail_len < Self::ENCODED_LEN {
28397 payload_buf[0..avail_len].copy_from_slice(__input);
28398 Bytes::new(&payload_buf)
28399 } else {
28400 Bytes::new(__input)
28401 };
28402 let mut __struct = Self::default();
28403 __struct.custom_mode = buf.get_u32_le();
28404 __struct.target_system = buf.get_u8();
28405 let tmp = buf.get_u8();
28406 __struct.base_mode =
28407 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28408 enum_type: "MavMode",
28409 value: tmp as u32,
28410 })?;
28411 Ok(__struct)
28412 }
28413 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28414 let mut __tmp = BytesMut::new(bytes);
28415 #[allow(clippy::absurd_extreme_comparisons)]
28416 #[allow(unused_comparisons)]
28417 if __tmp.remaining() < Self::ENCODED_LEN {
28418 panic!(
28419 "buffer is too small (need {} bytes, but got {})",
28420 Self::ENCODED_LEN,
28421 __tmp.remaining(),
28422 )
28423 }
28424 __tmp.put_u32_le(self.custom_mode);
28425 __tmp.put_u8(self.target_system);
28426 __tmp.put_u8(self.base_mode as u8);
28427 if matches!(version, MavlinkVersion::V2) {
28428 let len = __tmp.len();
28429 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28430 } else {
28431 __tmp.len()
28432 }
28433 }
28434}
28435#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28436#[doc = ""]
28437#[doc = "ID: 86"]
28438#[derive(Debug, Clone, PartialEq)]
28439#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28440#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28441#[cfg_attr(feature = "ts", derive(TS))]
28442#[cfg_attr(feature = "ts", ts(export))]
28443pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28444 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28445 pub time_boot_ms: u32,
28446 #[doc = "Latitude in WGS84 frame"]
28447 pub lat_int: i32,
28448 #[doc = "Longitude in WGS84 frame"]
28449 pub lon_int: i32,
28450 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28451 pub alt: f32,
28452 #[doc = "X velocity in NED frame"]
28453 pub vx: f32,
28454 #[doc = "Y velocity in NED frame"]
28455 pub vy: f32,
28456 #[doc = "Z velocity in NED frame"]
28457 pub vz: f32,
28458 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28459 pub afx: f32,
28460 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28461 pub afy: f32,
28462 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28463 pub afz: f32,
28464 #[doc = "yaw setpoint"]
28465 pub yaw: f32,
28466 #[doc = "yaw rate setpoint"]
28467 pub yaw_rate: f32,
28468 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28469 pub type_mask: PositionTargetTypemask,
28470 #[doc = "System ID"]
28471 pub target_system: u8,
28472 #[doc = "Component ID"]
28473 pub target_component: u8,
28474 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28475 pub coordinate_frame: MavFrame,
28476}
28477impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28478 pub const ENCODED_LEN: usize = 53usize;
28479 pub const DEFAULT: Self = Self {
28480 time_boot_ms: 0_u32,
28481 lat_int: 0_i32,
28482 lon_int: 0_i32,
28483 alt: 0.0_f32,
28484 vx: 0.0_f32,
28485 vy: 0.0_f32,
28486 vz: 0.0_f32,
28487 afx: 0.0_f32,
28488 afy: 0.0_f32,
28489 afz: 0.0_f32,
28490 yaw: 0.0_f32,
28491 yaw_rate: 0.0_f32,
28492 type_mask: PositionTargetTypemask::DEFAULT,
28493 target_system: 0_u8,
28494 target_component: 0_u8,
28495 coordinate_frame: MavFrame::DEFAULT,
28496 };
28497 #[cfg(feature = "arbitrary")]
28498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28499 use arbitrary::{Arbitrary, Unstructured};
28500 let mut buf = [0u8; 1024];
28501 rng.fill_bytes(&mut buf);
28502 let mut unstructured = Unstructured::new(&buf);
28503 Self::arbitrary(&mut unstructured).unwrap_or_default()
28504 }
28505}
28506impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28507 fn default() -> Self {
28508 Self::DEFAULT.clone()
28509 }
28510}
28511impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28512 type Message = MavMessage;
28513 const ID: u32 = 86u32;
28514 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28515 const EXTRA_CRC: u8 = 5u8;
28516 const ENCODED_LEN: usize = 53usize;
28517 fn deser(
28518 _version: MavlinkVersion,
28519 __input: &[u8],
28520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28521 let avail_len = __input.len();
28522 let mut payload_buf = [0; Self::ENCODED_LEN];
28523 let mut buf = if avail_len < Self::ENCODED_LEN {
28524 payload_buf[0..avail_len].copy_from_slice(__input);
28525 Bytes::new(&payload_buf)
28526 } else {
28527 Bytes::new(__input)
28528 };
28529 let mut __struct = Self::default();
28530 __struct.time_boot_ms = buf.get_u32_le();
28531 __struct.lat_int = buf.get_i32_le();
28532 __struct.lon_int = buf.get_i32_le();
28533 __struct.alt = buf.get_f32_le();
28534 __struct.vx = buf.get_f32_le();
28535 __struct.vy = buf.get_f32_le();
28536 __struct.vz = buf.get_f32_le();
28537 __struct.afx = buf.get_f32_le();
28538 __struct.afy = buf.get_f32_le();
28539 __struct.afz = buf.get_f32_le();
28540 __struct.yaw = buf.get_f32_le();
28541 __struct.yaw_rate = buf.get_f32_le();
28542 let tmp = buf.get_u16_le();
28543 __struct.type_mask = PositionTargetTypemask::from_bits(
28544 tmp & PositionTargetTypemask::all().bits(),
28545 )
28546 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28547 flag_type: "PositionTargetTypemask",
28548 value: tmp as u32,
28549 })?;
28550 __struct.target_system = buf.get_u8();
28551 __struct.target_component = buf.get_u8();
28552 let tmp = buf.get_u8();
28553 __struct.coordinate_frame =
28554 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28555 enum_type: "MavFrame",
28556 value: tmp as u32,
28557 })?;
28558 Ok(__struct)
28559 }
28560 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28561 let mut __tmp = BytesMut::new(bytes);
28562 #[allow(clippy::absurd_extreme_comparisons)]
28563 #[allow(unused_comparisons)]
28564 if __tmp.remaining() < Self::ENCODED_LEN {
28565 panic!(
28566 "buffer is too small (need {} bytes, but got {})",
28567 Self::ENCODED_LEN,
28568 __tmp.remaining(),
28569 )
28570 }
28571 __tmp.put_u32_le(self.time_boot_ms);
28572 __tmp.put_i32_le(self.lat_int);
28573 __tmp.put_i32_le(self.lon_int);
28574 __tmp.put_f32_le(self.alt);
28575 __tmp.put_f32_le(self.vx);
28576 __tmp.put_f32_le(self.vy);
28577 __tmp.put_f32_le(self.vz);
28578 __tmp.put_f32_le(self.afx);
28579 __tmp.put_f32_le(self.afy);
28580 __tmp.put_f32_le(self.afz);
28581 __tmp.put_f32_le(self.yaw);
28582 __tmp.put_f32_le(self.yaw_rate);
28583 __tmp.put_u16_le(self.type_mask.bits());
28584 __tmp.put_u8(self.target_system);
28585 __tmp.put_u8(self.target_component);
28586 __tmp.put_u8(self.coordinate_frame as u8);
28587 if matches!(version, MavlinkVersion::V2) {
28588 let len = __tmp.len();
28589 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28590 } else {
28591 __tmp.len()
28592 }
28593 }
28594}
28595#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28596#[doc = ""]
28597#[doc = "ID: 84"]
28598#[derive(Debug, Clone, PartialEq)]
28599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28601#[cfg_attr(feature = "ts", derive(TS))]
28602#[cfg_attr(feature = "ts", ts(export))]
28603pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28604 #[doc = "Timestamp (time since system boot)."]
28605 pub time_boot_ms: u32,
28606 #[doc = "X Position in NED frame"]
28607 pub x: f32,
28608 #[doc = "Y Position in NED frame"]
28609 pub y: f32,
28610 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28611 pub z: f32,
28612 #[doc = "X velocity in NED frame"]
28613 pub vx: f32,
28614 #[doc = "Y velocity in NED frame"]
28615 pub vy: f32,
28616 #[doc = "Z velocity in NED frame"]
28617 pub vz: f32,
28618 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28619 pub afx: f32,
28620 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28621 pub afy: f32,
28622 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28623 pub afz: f32,
28624 #[doc = "yaw setpoint"]
28625 pub yaw: f32,
28626 #[doc = "yaw rate setpoint"]
28627 pub yaw_rate: f32,
28628 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28629 pub type_mask: PositionTargetTypemask,
28630 #[doc = "System ID"]
28631 pub target_system: u8,
28632 #[doc = "Component ID"]
28633 pub target_component: u8,
28634 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28635 pub coordinate_frame: MavFrame,
28636}
28637impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28638 pub const ENCODED_LEN: usize = 53usize;
28639 pub const DEFAULT: Self = Self {
28640 time_boot_ms: 0_u32,
28641 x: 0.0_f32,
28642 y: 0.0_f32,
28643 z: 0.0_f32,
28644 vx: 0.0_f32,
28645 vy: 0.0_f32,
28646 vz: 0.0_f32,
28647 afx: 0.0_f32,
28648 afy: 0.0_f32,
28649 afz: 0.0_f32,
28650 yaw: 0.0_f32,
28651 yaw_rate: 0.0_f32,
28652 type_mask: PositionTargetTypemask::DEFAULT,
28653 target_system: 0_u8,
28654 target_component: 0_u8,
28655 coordinate_frame: MavFrame::DEFAULT,
28656 };
28657 #[cfg(feature = "arbitrary")]
28658 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28659 use arbitrary::{Arbitrary, Unstructured};
28660 let mut buf = [0u8; 1024];
28661 rng.fill_bytes(&mut buf);
28662 let mut unstructured = Unstructured::new(&buf);
28663 Self::arbitrary(&mut unstructured).unwrap_or_default()
28664 }
28665}
28666impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28667 fn default() -> Self {
28668 Self::DEFAULT.clone()
28669 }
28670}
28671impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28672 type Message = MavMessage;
28673 const ID: u32 = 84u32;
28674 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28675 const EXTRA_CRC: u8 = 143u8;
28676 const ENCODED_LEN: usize = 53usize;
28677 fn deser(
28678 _version: MavlinkVersion,
28679 __input: &[u8],
28680 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28681 let avail_len = __input.len();
28682 let mut payload_buf = [0; Self::ENCODED_LEN];
28683 let mut buf = if avail_len < Self::ENCODED_LEN {
28684 payload_buf[0..avail_len].copy_from_slice(__input);
28685 Bytes::new(&payload_buf)
28686 } else {
28687 Bytes::new(__input)
28688 };
28689 let mut __struct = Self::default();
28690 __struct.time_boot_ms = buf.get_u32_le();
28691 __struct.x = buf.get_f32_le();
28692 __struct.y = buf.get_f32_le();
28693 __struct.z = buf.get_f32_le();
28694 __struct.vx = buf.get_f32_le();
28695 __struct.vy = buf.get_f32_le();
28696 __struct.vz = buf.get_f32_le();
28697 __struct.afx = buf.get_f32_le();
28698 __struct.afy = buf.get_f32_le();
28699 __struct.afz = buf.get_f32_le();
28700 __struct.yaw = buf.get_f32_le();
28701 __struct.yaw_rate = buf.get_f32_le();
28702 let tmp = buf.get_u16_le();
28703 __struct.type_mask = PositionTargetTypemask::from_bits(
28704 tmp & PositionTargetTypemask::all().bits(),
28705 )
28706 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28707 flag_type: "PositionTargetTypemask",
28708 value: tmp as u32,
28709 })?;
28710 __struct.target_system = buf.get_u8();
28711 __struct.target_component = buf.get_u8();
28712 let tmp = buf.get_u8();
28713 __struct.coordinate_frame =
28714 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28715 enum_type: "MavFrame",
28716 value: tmp as u32,
28717 })?;
28718 Ok(__struct)
28719 }
28720 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28721 let mut __tmp = BytesMut::new(bytes);
28722 #[allow(clippy::absurd_extreme_comparisons)]
28723 #[allow(unused_comparisons)]
28724 if __tmp.remaining() < Self::ENCODED_LEN {
28725 panic!(
28726 "buffer is too small (need {} bytes, but got {})",
28727 Self::ENCODED_LEN,
28728 __tmp.remaining(),
28729 )
28730 }
28731 __tmp.put_u32_le(self.time_boot_ms);
28732 __tmp.put_f32_le(self.x);
28733 __tmp.put_f32_le(self.y);
28734 __tmp.put_f32_le(self.z);
28735 __tmp.put_f32_le(self.vx);
28736 __tmp.put_f32_le(self.vy);
28737 __tmp.put_f32_le(self.vz);
28738 __tmp.put_f32_le(self.afx);
28739 __tmp.put_f32_le(self.afy);
28740 __tmp.put_f32_le(self.afz);
28741 __tmp.put_f32_le(self.yaw);
28742 __tmp.put_f32_le(self.yaw_rate);
28743 __tmp.put_u16_le(self.type_mask.bits());
28744 __tmp.put_u8(self.target_system);
28745 __tmp.put_u8(self.target_component);
28746 __tmp.put_u8(self.coordinate_frame as u8);
28747 if matches!(version, MavlinkVersion::V2) {
28748 let len = __tmp.len();
28749 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28750 } else {
28751 __tmp.len()
28752 }
28753 }
28754}
28755#[doc = "Status of simulation environment, if used."]
28756#[doc = ""]
28757#[doc = "ID: 108"]
28758#[derive(Debug, Clone, PartialEq)]
28759#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28761#[cfg_attr(feature = "ts", derive(TS))]
28762#[cfg_attr(feature = "ts", ts(export))]
28763pub struct SIM_STATE_DATA {
28764 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28765 pub q1: f32,
28766 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28767 pub q2: f32,
28768 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28769 pub q3: f32,
28770 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28771 pub q4: f32,
28772 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28773 pub roll: f32,
28774 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28775 pub pitch: f32,
28776 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28777 pub yaw: f32,
28778 #[doc = "X acceleration"]
28779 pub xacc: f32,
28780 #[doc = "Y acceleration"]
28781 pub yacc: f32,
28782 #[doc = "Z acceleration"]
28783 pub zacc: f32,
28784 #[doc = "Angular speed around X axis"]
28785 pub xgyro: f32,
28786 #[doc = "Angular speed around Y axis"]
28787 pub ygyro: f32,
28788 #[doc = "Angular speed around Z axis"]
28789 pub zgyro: f32,
28790 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28791 pub lat: f32,
28792 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28793 pub lon: f32,
28794 #[doc = "Altitude"]
28795 pub alt: f32,
28796 #[doc = "Horizontal position standard deviation"]
28797 pub std_dev_horz: f32,
28798 #[doc = "Vertical position standard deviation"]
28799 pub std_dev_vert: f32,
28800 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28801 pub vn: f32,
28802 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28803 pub ve: f32,
28804 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28805 pub vd: f32,
28806 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28807 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28808 pub lat_int: i32,
28809 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28810 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28811 pub lon_int: i32,
28812}
28813impl SIM_STATE_DATA {
28814 pub const ENCODED_LEN: usize = 92usize;
28815 pub const DEFAULT: Self = Self {
28816 q1: 0.0_f32,
28817 q2: 0.0_f32,
28818 q3: 0.0_f32,
28819 q4: 0.0_f32,
28820 roll: 0.0_f32,
28821 pitch: 0.0_f32,
28822 yaw: 0.0_f32,
28823 xacc: 0.0_f32,
28824 yacc: 0.0_f32,
28825 zacc: 0.0_f32,
28826 xgyro: 0.0_f32,
28827 ygyro: 0.0_f32,
28828 zgyro: 0.0_f32,
28829 lat: 0.0_f32,
28830 lon: 0.0_f32,
28831 alt: 0.0_f32,
28832 std_dev_horz: 0.0_f32,
28833 std_dev_vert: 0.0_f32,
28834 vn: 0.0_f32,
28835 ve: 0.0_f32,
28836 vd: 0.0_f32,
28837 lat_int: 0_i32,
28838 lon_int: 0_i32,
28839 };
28840 #[cfg(feature = "arbitrary")]
28841 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28842 use arbitrary::{Arbitrary, Unstructured};
28843 let mut buf = [0u8; 1024];
28844 rng.fill_bytes(&mut buf);
28845 let mut unstructured = Unstructured::new(&buf);
28846 Self::arbitrary(&mut unstructured).unwrap_or_default()
28847 }
28848}
28849impl Default for SIM_STATE_DATA {
28850 fn default() -> Self {
28851 Self::DEFAULT.clone()
28852 }
28853}
28854impl MessageData for SIM_STATE_DATA {
28855 type Message = MavMessage;
28856 const ID: u32 = 108u32;
28857 const NAME: &'static str = "SIM_STATE";
28858 const EXTRA_CRC: u8 = 32u8;
28859 const ENCODED_LEN: usize = 92usize;
28860 fn deser(
28861 _version: MavlinkVersion,
28862 __input: &[u8],
28863 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28864 let avail_len = __input.len();
28865 let mut payload_buf = [0; Self::ENCODED_LEN];
28866 let mut buf = if avail_len < Self::ENCODED_LEN {
28867 payload_buf[0..avail_len].copy_from_slice(__input);
28868 Bytes::new(&payload_buf)
28869 } else {
28870 Bytes::new(__input)
28871 };
28872 let mut __struct = Self::default();
28873 __struct.q1 = buf.get_f32_le();
28874 __struct.q2 = buf.get_f32_le();
28875 __struct.q3 = buf.get_f32_le();
28876 __struct.q4 = buf.get_f32_le();
28877 __struct.roll = buf.get_f32_le();
28878 __struct.pitch = buf.get_f32_le();
28879 __struct.yaw = buf.get_f32_le();
28880 __struct.xacc = buf.get_f32_le();
28881 __struct.yacc = buf.get_f32_le();
28882 __struct.zacc = buf.get_f32_le();
28883 __struct.xgyro = buf.get_f32_le();
28884 __struct.ygyro = buf.get_f32_le();
28885 __struct.zgyro = buf.get_f32_le();
28886 __struct.lat = buf.get_f32_le();
28887 __struct.lon = buf.get_f32_le();
28888 __struct.alt = buf.get_f32_le();
28889 __struct.std_dev_horz = buf.get_f32_le();
28890 __struct.std_dev_vert = buf.get_f32_le();
28891 __struct.vn = buf.get_f32_le();
28892 __struct.ve = buf.get_f32_le();
28893 __struct.vd = buf.get_f32_le();
28894 __struct.lat_int = buf.get_i32_le();
28895 __struct.lon_int = buf.get_i32_le();
28896 Ok(__struct)
28897 }
28898 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28899 let mut __tmp = BytesMut::new(bytes);
28900 #[allow(clippy::absurd_extreme_comparisons)]
28901 #[allow(unused_comparisons)]
28902 if __tmp.remaining() < Self::ENCODED_LEN {
28903 panic!(
28904 "buffer is too small (need {} bytes, but got {})",
28905 Self::ENCODED_LEN,
28906 __tmp.remaining(),
28907 )
28908 }
28909 __tmp.put_f32_le(self.q1);
28910 __tmp.put_f32_le(self.q2);
28911 __tmp.put_f32_le(self.q3);
28912 __tmp.put_f32_le(self.q4);
28913 __tmp.put_f32_le(self.roll);
28914 __tmp.put_f32_le(self.pitch);
28915 __tmp.put_f32_le(self.yaw);
28916 __tmp.put_f32_le(self.xacc);
28917 __tmp.put_f32_le(self.yacc);
28918 __tmp.put_f32_le(self.zacc);
28919 __tmp.put_f32_le(self.xgyro);
28920 __tmp.put_f32_le(self.ygyro);
28921 __tmp.put_f32_le(self.zgyro);
28922 __tmp.put_f32_le(self.lat);
28923 __tmp.put_f32_le(self.lon);
28924 __tmp.put_f32_le(self.alt);
28925 __tmp.put_f32_le(self.std_dev_horz);
28926 __tmp.put_f32_le(self.std_dev_vert);
28927 __tmp.put_f32_le(self.vn);
28928 __tmp.put_f32_le(self.ve);
28929 __tmp.put_f32_le(self.vd);
28930 if matches!(version, MavlinkVersion::V2) {
28931 __tmp.put_i32_le(self.lat_int);
28932 __tmp.put_i32_le(self.lon_int);
28933 let len = __tmp.len();
28934 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28935 } else {
28936 __tmp.len()
28937 }
28938 }
28939}
28940#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28941#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28942#[doc = ""]
28943#[doc = "ID: 370"]
28944#[derive(Debug, Clone, PartialEq)]
28945#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28947#[cfg_attr(feature = "ts", derive(TS))]
28948#[cfg_attr(feature = "ts", ts(export))]
28949pub struct SMART_BATTERY_INFO_DATA {
28950 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28951 pub capacity_full_specification: i32,
28952 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28953 pub capacity_full: i32,
28954 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28955 pub cycle_count: u16,
28956 #[doc = "Battery weight. 0: field not provided."]
28957 pub weight: u16,
28958 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28959 pub discharge_minimum_voltage: u16,
28960 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28961 pub charging_minimum_voltage: u16,
28962 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28963 pub resting_minimum_voltage: u16,
28964 #[doc = "Battery ID"]
28965 pub id: u8,
28966 #[doc = "Function of the battery"]
28967 pub battery_function: MavBatteryFunction,
28968 #[doc = "Type (chemistry) of the battery"]
28969 pub mavtype: MavBatteryType,
28970 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28971 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28972 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28973 pub serial_number: [u8; 16],
28974 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28975 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28976 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28977 pub device_name: [u8; 50],
28978 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28979 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28980 pub charging_maximum_voltage: u16,
28981 #[doc = "Number of battery cells in series. 0: field not provided."]
28982 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28983 pub cells_in_series: u8,
28984 #[doc = "Maximum pack discharge current. 0: field not provided."]
28985 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28986 pub discharge_maximum_current: u32,
28987 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28988 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28989 pub discharge_maximum_burst_current: u32,
28990 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28991 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28992 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28993 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28994 pub manufacture_date: [u8; 11],
28995}
28996impl SMART_BATTERY_INFO_DATA {
28997 pub const ENCODED_LEN: usize = 109usize;
28998 pub const DEFAULT: Self = Self {
28999 capacity_full_specification: 0_i32,
29000 capacity_full: 0_i32,
29001 cycle_count: 0_u16,
29002 weight: 0_u16,
29003 discharge_minimum_voltage: 0_u16,
29004 charging_minimum_voltage: 0_u16,
29005 resting_minimum_voltage: 0_u16,
29006 id: 0_u8,
29007 battery_function: MavBatteryFunction::DEFAULT,
29008 mavtype: MavBatteryType::DEFAULT,
29009 serial_number: [0_u8; 16usize],
29010 device_name: [0_u8; 50usize],
29011 charging_maximum_voltage: 0_u16,
29012 cells_in_series: 0_u8,
29013 discharge_maximum_current: 0_u32,
29014 discharge_maximum_burst_current: 0_u32,
29015 manufacture_date: [0_u8; 11usize],
29016 };
29017 #[cfg(feature = "arbitrary")]
29018 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29019 use arbitrary::{Arbitrary, Unstructured};
29020 let mut buf = [0u8; 1024];
29021 rng.fill_bytes(&mut buf);
29022 let mut unstructured = Unstructured::new(&buf);
29023 Self::arbitrary(&mut unstructured).unwrap_or_default()
29024 }
29025}
29026impl Default for SMART_BATTERY_INFO_DATA {
29027 fn default() -> Self {
29028 Self::DEFAULT.clone()
29029 }
29030}
29031impl MessageData for SMART_BATTERY_INFO_DATA {
29032 type Message = MavMessage;
29033 const ID: u32 = 370u32;
29034 const NAME: &'static str = "SMART_BATTERY_INFO";
29035 const EXTRA_CRC: u8 = 75u8;
29036 const ENCODED_LEN: usize = 109usize;
29037 fn deser(
29038 _version: MavlinkVersion,
29039 __input: &[u8],
29040 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29041 let avail_len = __input.len();
29042 let mut payload_buf = [0; Self::ENCODED_LEN];
29043 let mut buf = if avail_len < Self::ENCODED_LEN {
29044 payload_buf[0..avail_len].copy_from_slice(__input);
29045 Bytes::new(&payload_buf)
29046 } else {
29047 Bytes::new(__input)
29048 };
29049 let mut __struct = Self::default();
29050 __struct.capacity_full_specification = buf.get_i32_le();
29051 __struct.capacity_full = buf.get_i32_le();
29052 __struct.cycle_count = buf.get_u16_le();
29053 __struct.weight = buf.get_u16_le();
29054 __struct.discharge_minimum_voltage = buf.get_u16_le();
29055 __struct.charging_minimum_voltage = buf.get_u16_le();
29056 __struct.resting_minimum_voltage = buf.get_u16_le();
29057 __struct.id = buf.get_u8();
29058 let tmp = buf.get_u8();
29059 __struct.battery_function =
29060 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29061 enum_type: "MavBatteryFunction",
29062 value: tmp as u32,
29063 })?;
29064 let tmp = buf.get_u8();
29065 __struct.mavtype =
29066 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29067 enum_type: "MavBatteryType",
29068 value: tmp as u32,
29069 })?;
29070 for v in &mut __struct.serial_number {
29071 let val = buf.get_u8();
29072 *v = val;
29073 }
29074 for v in &mut __struct.device_name {
29075 let val = buf.get_u8();
29076 *v = val;
29077 }
29078 __struct.charging_maximum_voltage = buf.get_u16_le();
29079 __struct.cells_in_series = buf.get_u8();
29080 __struct.discharge_maximum_current = buf.get_u32_le();
29081 __struct.discharge_maximum_burst_current = buf.get_u32_le();
29082 for v in &mut __struct.manufacture_date {
29083 let val = buf.get_u8();
29084 *v = val;
29085 }
29086 Ok(__struct)
29087 }
29088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29089 let mut __tmp = BytesMut::new(bytes);
29090 #[allow(clippy::absurd_extreme_comparisons)]
29091 #[allow(unused_comparisons)]
29092 if __tmp.remaining() < Self::ENCODED_LEN {
29093 panic!(
29094 "buffer is too small (need {} bytes, but got {})",
29095 Self::ENCODED_LEN,
29096 __tmp.remaining(),
29097 )
29098 }
29099 __tmp.put_i32_le(self.capacity_full_specification);
29100 __tmp.put_i32_le(self.capacity_full);
29101 __tmp.put_u16_le(self.cycle_count);
29102 __tmp.put_u16_le(self.weight);
29103 __tmp.put_u16_le(self.discharge_minimum_voltage);
29104 __tmp.put_u16_le(self.charging_minimum_voltage);
29105 __tmp.put_u16_le(self.resting_minimum_voltage);
29106 __tmp.put_u8(self.id);
29107 __tmp.put_u8(self.battery_function as u8);
29108 __tmp.put_u8(self.mavtype as u8);
29109 for val in &self.serial_number {
29110 __tmp.put_u8(*val);
29111 }
29112 for val in &self.device_name {
29113 __tmp.put_u8(*val);
29114 }
29115 if matches!(version, MavlinkVersion::V2) {
29116 __tmp.put_u16_le(self.charging_maximum_voltage);
29117 __tmp.put_u8(self.cells_in_series);
29118 __tmp.put_u32_le(self.discharge_maximum_current);
29119 __tmp.put_u32_le(self.discharge_maximum_burst_current);
29120 for val in &self.manufacture_date {
29121 __tmp.put_u8(*val);
29122 }
29123 let len = __tmp.len();
29124 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29125 } else {
29126 __tmp.len()
29127 }
29128 }
29129}
29130#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
29131#[doc = ""]
29132#[doc = "ID: 253"]
29133#[derive(Debug, Clone, PartialEq)]
29134#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29136#[cfg_attr(feature = "ts", derive(TS))]
29137#[cfg_attr(feature = "ts", ts(export))]
29138pub struct STATUSTEXT_DATA {
29139 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
29140 pub severity: MavSeverity,
29141 #[doc = "Status text message, without null termination character"]
29142 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29143 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29144 pub text: [u8; 50],
29145 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
29146 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29147 pub id: u16,
29148 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
29149 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29150 pub chunk_seq: u8,
29151}
29152impl STATUSTEXT_DATA {
29153 pub const ENCODED_LEN: usize = 54usize;
29154 pub const DEFAULT: Self = Self {
29155 severity: MavSeverity::DEFAULT,
29156 text: [0_u8; 50usize],
29157 id: 0_u16,
29158 chunk_seq: 0_u8,
29159 };
29160 #[cfg(feature = "arbitrary")]
29161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29162 use arbitrary::{Arbitrary, Unstructured};
29163 let mut buf = [0u8; 1024];
29164 rng.fill_bytes(&mut buf);
29165 let mut unstructured = Unstructured::new(&buf);
29166 Self::arbitrary(&mut unstructured).unwrap_or_default()
29167 }
29168}
29169impl Default for STATUSTEXT_DATA {
29170 fn default() -> Self {
29171 Self::DEFAULT.clone()
29172 }
29173}
29174impl MessageData for STATUSTEXT_DATA {
29175 type Message = MavMessage;
29176 const ID: u32 = 253u32;
29177 const NAME: &'static str = "STATUSTEXT";
29178 const EXTRA_CRC: u8 = 83u8;
29179 const ENCODED_LEN: usize = 54usize;
29180 fn deser(
29181 _version: MavlinkVersion,
29182 __input: &[u8],
29183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29184 let avail_len = __input.len();
29185 let mut payload_buf = [0; Self::ENCODED_LEN];
29186 let mut buf = if avail_len < Self::ENCODED_LEN {
29187 payload_buf[0..avail_len].copy_from_slice(__input);
29188 Bytes::new(&payload_buf)
29189 } else {
29190 Bytes::new(__input)
29191 };
29192 let mut __struct = Self::default();
29193 let tmp = buf.get_u8();
29194 __struct.severity =
29195 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29196 enum_type: "MavSeverity",
29197 value: tmp as u32,
29198 })?;
29199 for v in &mut __struct.text {
29200 let val = buf.get_u8();
29201 *v = val;
29202 }
29203 __struct.id = buf.get_u16_le();
29204 __struct.chunk_seq = buf.get_u8();
29205 Ok(__struct)
29206 }
29207 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29208 let mut __tmp = BytesMut::new(bytes);
29209 #[allow(clippy::absurd_extreme_comparisons)]
29210 #[allow(unused_comparisons)]
29211 if __tmp.remaining() < Self::ENCODED_LEN {
29212 panic!(
29213 "buffer is too small (need {} bytes, but got {})",
29214 Self::ENCODED_LEN,
29215 __tmp.remaining(),
29216 )
29217 }
29218 __tmp.put_u8(self.severity as u8);
29219 for val in &self.text {
29220 __tmp.put_u8(*val);
29221 }
29222 if matches!(version, MavlinkVersion::V2) {
29223 __tmp.put_u16_le(self.id);
29224 __tmp.put_u8(self.chunk_seq);
29225 let len = __tmp.len();
29226 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29227 } else {
29228 __tmp.len()
29229 }
29230 }
29231}
29232#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29233#[doc = ""]
29234#[doc = "ID: 261"]
29235#[derive(Debug, Clone, PartialEq)]
29236#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29237#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29238#[cfg_attr(feature = "ts", derive(TS))]
29239#[cfg_attr(feature = "ts", ts(export))]
29240pub struct STORAGE_INFORMATION_DATA {
29241 #[doc = "Timestamp (time since system boot)."]
29242 pub time_boot_ms: u32,
29243 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29244 pub total_capacity: f32,
29245 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29246 pub used_capacity: f32,
29247 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29248 pub available_capacity: f32,
29249 #[doc = "Read speed."]
29250 pub read_speed: f32,
29251 #[doc = "Write speed."]
29252 pub write_speed: f32,
29253 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29254 pub storage_id: u8,
29255 #[doc = "Number of storage devices"]
29256 pub storage_count: u8,
29257 #[doc = "Status of storage"]
29258 pub status: StorageStatus,
29259 #[doc = "Type of storage"]
29260 #[cfg_attr(feature = "serde", serde(default))]
29261 pub mavtype: StorageType,
29262 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29263 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29264 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29265 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29266 pub name: [u8; 32],
29267 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29268 #[cfg_attr(feature = "serde", serde(default))]
29269 pub storage_usage: StorageUsageFlag,
29270}
29271impl STORAGE_INFORMATION_DATA {
29272 pub const ENCODED_LEN: usize = 61usize;
29273 pub const DEFAULT: Self = Self {
29274 time_boot_ms: 0_u32,
29275 total_capacity: 0.0_f32,
29276 used_capacity: 0.0_f32,
29277 available_capacity: 0.0_f32,
29278 read_speed: 0.0_f32,
29279 write_speed: 0.0_f32,
29280 storage_id: 0_u8,
29281 storage_count: 0_u8,
29282 status: StorageStatus::DEFAULT,
29283 mavtype: StorageType::DEFAULT,
29284 name: [0_u8; 32usize],
29285 storage_usage: StorageUsageFlag::DEFAULT,
29286 };
29287 #[cfg(feature = "arbitrary")]
29288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29289 use arbitrary::{Arbitrary, Unstructured};
29290 let mut buf = [0u8; 1024];
29291 rng.fill_bytes(&mut buf);
29292 let mut unstructured = Unstructured::new(&buf);
29293 Self::arbitrary(&mut unstructured).unwrap_or_default()
29294 }
29295}
29296impl Default for STORAGE_INFORMATION_DATA {
29297 fn default() -> Self {
29298 Self::DEFAULT.clone()
29299 }
29300}
29301impl MessageData for STORAGE_INFORMATION_DATA {
29302 type Message = MavMessage;
29303 const ID: u32 = 261u32;
29304 const NAME: &'static str = "STORAGE_INFORMATION";
29305 const EXTRA_CRC: u8 = 179u8;
29306 const ENCODED_LEN: usize = 61usize;
29307 fn deser(
29308 _version: MavlinkVersion,
29309 __input: &[u8],
29310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29311 let avail_len = __input.len();
29312 let mut payload_buf = [0; Self::ENCODED_LEN];
29313 let mut buf = if avail_len < Self::ENCODED_LEN {
29314 payload_buf[0..avail_len].copy_from_slice(__input);
29315 Bytes::new(&payload_buf)
29316 } else {
29317 Bytes::new(__input)
29318 };
29319 let mut __struct = Self::default();
29320 __struct.time_boot_ms = buf.get_u32_le();
29321 __struct.total_capacity = buf.get_f32_le();
29322 __struct.used_capacity = buf.get_f32_le();
29323 __struct.available_capacity = buf.get_f32_le();
29324 __struct.read_speed = buf.get_f32_le();
29325 __struct.write_speed = buf.get_f32_le();
29326 __struct.storage_id = buf.get_u8();
29327 __struct.storage_count = buf.get_u8();
29328 let tmp = buf.get_u8();
29329 __struct.status =
29330 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29331 enum_type: "StorageStatus",
29332 value: tmp as u32,
29333 })?;
29334 let tmp = buf.get_u8();
29335 __struct.mavtype =
29336 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29337 enum_type: "StorageType",
29338 value: tmp as u32,
29339 })?;
29340 for v in &mut __struct.name {
29341 let val = buf.get_u8();
29342 *v = val;
29343 }
29344 let tmp = buf.get_u8();
29345 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
29346 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29347 flag_type: "StorageUsageFlag",
29348 value: tmp as u32,
29349 })?;
29350 Ok(__struct)
29351 }
29352 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29353 let mut __tmp = BytesMut::new(bytes);
29354 #[allow(clippy::absurd_extreme_comparisons)]
29355 #[allow(unused_comparisons)]
29356 if __tmp.remaining() < Self::ENCODED_LEN {
29357 panic!(
29358 "buffer is too small (need {} bytes, but got {})",
29359 Self::ENCODED_LEN,
29360 __tmp.remaining(),
29361 )
29362 }
29363 __tmp.put_u32_le(self.time_boot_ms);
29364 __tmp.put_f32_le(self.total_capacity);
29365 __tmp.put_f32_le(self.used_capacity);
29366 __tmp.put_f32_le(self.available_capacity);
29367 __tmp.put_f32_le(self.read_speed);
29368 __tmp.put_f32_le(self.write_speed);
29369 __tmp.put_u8(self.storage_id);
29370 __tmp.put_u8(self.storage_count);
29371 __tmp.put_u8(self.status as u8);
29372 if matches!(version, MavlinkVersion::V2) {
29373 __tmp.put_u8(self.mavtype as u8);
29374 for val in &self.name {
29375 __tmp.put_u8(*val);
29376 }
29377 __tmp.put_u8(self.storage_usage.bits());
29378 let len = __tmp.len();
29379 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29380 } else {
29381 __tmp.len()
29382 }
29383 }
29384}
29385#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29386#[doc = ""]
29387#[doc = "ID: 401"]
29388#[derive(Debug, Clone, PartialEq)]
29389#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29390#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29391#[cfg_attr(feature = "ts", derive(TS))]
29392#[cfg_attr(feature = "ts", ts(export))]
29393pub struct SUPPORTED_TUNES_DATA {
29394 #[doc = "Bitfield of supported tune formats."]
29395 pub format: TuneFormat,
29396 #[doc = "System ID"]
29397 pub target_system: u8,
29398 #[doc = "Component ID"]
29399 pub target_component: u8,
29400}
29401impl SUPPORTED_TUNES_DATA {
29402 pub const ENCODED_LEN: usize = 6usize;
29403 pub const DEFAULT: Self = Self {
29404 format: TuneFormat::DEFAULT,
29405 target_system: 0_u8,
29406 target_component: 0_u8,
29407 };
29408 #[cfg(feature = "arbitrary")]
29409 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29410 use arbitrary::{Arbitrary, Unstructured};
29411 let mut buf = [0u8; 1024];
29412 rng.fill_bytes(&mut buf);
29413 let mut unstructured = Unstructured::new(&buf);
29414 Self::arbitrary(&mut unstructured).unwrap_or_default()
29415 }
29416}
29417impl Default for SUPPORTED_TUNES_DATA {
29418 fn default() -> Self {
29419 Self::DEFAULT.clone()
29420 }
29421}
29422impl MessageData for SUPPORTED_TUNES_DATA {
29423 type Message = MavMessage;
29424 const ID: u32 = 401u32;
29425 const NAME: &'static str = "SUPPORTED_TUNES";
29426 const EXTRA_CRC: u8 = 183u8;
29427 const ENCODED_LEN: usize = 6usize;
29428 fn deser(
29429 _version: MavlinkVersion,
29430 __input: &[u8],
29431 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29432 let avail_len = __input.len();
29433 let mut payload_buf = [0; Self::ENCODED_LEN];
29434 let mut buf = if avail_len < Self::ENCODED_LEN {
29435 payload_buf[0..avail_len].copy_from_slice(__input);
29436 Bytes::new(&payload_buf)
29437 } else {
29438 Bytes::new(__input)
29439 };
29440 let mut __struct = Self::default();
29441 let tmp = buf.get_u32_le();
29442 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29443 ::mavlink_core::error::ParserError::InvalidEnum {
29444 enum_type: "TuneFormat",
29445 value: tmp as u32,
29446 },
29447 )?;
29448 __struct.target_system = buf.get_u8();
29449 __struct.target_component = buf.get_u8();
29450 Ok(__struct)
29451 }
29452 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29453 let mut __tmp = BytesMut::new(bytes);
29454 #[allow(clippy::absurd_extreme_comparisons)]
29455 #[allow(unused_comparisons)]
29456 if __tmp.remaining() < Self::ENCODED_LEN {
29457 panic!(
29458 "buffer is too small (need {} bytes, but got {})",
29459 Self::ENCODED_LEN,
29460 __tmp.remaining(),
29461 )
29462 }
29463 __tmp.put_u32_le(self.format as u32);
29464 __tmp.put_u8(self.target_system);
29465 __tmp.put_u8(self.target_component);
29466 if matches!(version, MavlinkVersion::V2) {
29467 let len = __tmp.len();
29468 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29469 } else {
29470 __tmp.len()
29471 }
29472 }
29473}
29474#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29475#[doc = ""]
29476#[doc = "ID: 2"]
29477#[derive(Debug, Clone, PartialEq)]
29478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29480#[cfg_attr(feature = "ts", derive(TS))]
29481#[cfg_attr(feature = "ts", ts(export))]
29482pub struct SYSTEM_TIME_DATA {
29483 #[doc = "Timestamp (UNIX epoch time)."]
29484 pub time_unix_usec: u64,
29485 #[doc = "Timestamp (time since system boot)."]
29486 pub time_boot_ms: u32,
29487}
29488impl SYSTEM_TIME_DATA {
29489 pub const ENCODED_LEN: usize = 12usize;
29490 pub const DEFAULT: Self = Self {
29491 time_unix_usec: 0_u64,
29492 time_boot_ms: 0_u32,
29493 };
29494 #[cfg(feature = "arbitrary")]
29495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29496 use arbitrary::{Arbitrary, Unstructured};
29497 let mut buf = [0u8; 1024];
29498 rng.fill_bytes(&mut buf);
29499 let mut unstructured = Unstructured::new(&buf);
29500 Self::arbitrary(&mut unstructured).unwrap_or_default()
29501 }
29502}
29503impl Default for SYSTEM_TIME_DATA {
29504 fn default() -> Self {
29505 Self::DEFAULT.clone()
29506 }
29507}
29508impl MessageData for SYSTEM_TIME_DATA {
29509 type Message = MavMessage;
29510 const ID: u32 = 2u32;
29511 const NAME: &'static str = "SYSTEM_TIME";
29512 const EXTRA_CRC: u8 = 137u8;
29513 const ENCODED_LEN: usize = 12usize;
29514 fn deser(
29515 _version: MavlinkVersion,
29516 __input: &[u8],
29517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29518 let avail_len = __input.len();
29519 let mut payload_buf = [0; Self::ENCODED_LEN];
29520 let mut buf = if avail_len < Self::ENCODED_LEN {
29521 payload_buf[0..avail_len].copy_from_slice(__input);
29522 Bytes::new(&payload_buf)
29523 } else {
29524 Bytes::new(__input)
29525 };
29526 let mut __struct = Self::default();
29527 __struct.time_unix_usec = buf.get_u64_le();
29528 __struct.time_boot_ms = buf.get_u32_le();
29529 Ok(__struct)
29530 }
29531 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29532 let mut __tmp = BytesMut::new(bytes);
29533 #[allow(clippy::absurd_extreme_comparisons)]
29534 #[allow(unused_comparisons)]
29535 if __tmp.remaining() < Self::ENCODED_LEN {
29536 panic!(
29537 "buffer is too small (need {} bytes, but got {})",
29538 Self::ENCODED_LEN,
29539 __tmp.remaining(),
29540 )
29541 }
29542 __tmp.put_u64_le(self.time_unix_usec);
29543 __tmp.put_u32_le(self.time_boot_ms);
29544 if matches!(version, MavlinkVersion::V2) {
29545 let len = __tmp.len();
29546 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29547 } else {
29548 __tmp.len()
29549 }
29550 }
29551}
29552#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29553#[doc = ""]
29554#[doc = "ID: 1"]
29555#[derive(Debug, Clone, PartialEq)]
29556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29557#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29558#[cfg_attr(feature = "ts", derive(TS))]
29559#[cfg_attr(feature = "ts", ts(export))]
29560pub struct SYS_STATUS_DATA {
29561 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29562 pub onboard_control_sensors_present: MavSysStatusSensor,
29563 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29564 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29565 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29566 pub onboard_control_sensors_health: MavSysStatusSensor,
29567 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29568 pub load: u16,
29569 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29570 pub voltage_battery: u16,
29571 #[doc = "Battery current, -1: Current not sent by autopilot"]
29572 pub current_battery: i16,
29573 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29574 pub drop_rate_comm: u16,
29575 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29576 pub errors_comm: u16,
29577 #[doc = "Autopilot-specific errors"]
29578 pub errors_count1: u16,
29579 #[doc = "Autopilot-specific errors"]
29580 pub errors_count2: u16,
29581 #[doc = "Autopilot-specific errors"]
29582 pub errors_count3: u16,
29583 #[doc = "Autopilot-specific errors"]
29584 pub errors_count4: u16,
29585 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29586 pub battery_remaining: i8,
29587 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29588 #[cfg_attr(feature = "serde", serde(default))]
29589 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29590 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29591 #[cfg_attr(feature = "serde", serde(default))]
29592 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29593 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29594 #[cfg_attr(feature = "serde", serde(default))]
29595 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29596}
29597impl SYS_STATUS_DATA {
29598 pub const ENCODED_LEN: usize = 43usize;
29599 pub const DEFAULT: Self = Self {
29600 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29601 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29602 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29603 load: 0_u16,
29604 voltage_battery: 0_u16,
29605 current_battery: 0_i16,
29606 drop_rate_comm: 0_u16,
29607 errors_comm: 0_u16,
29608 errors_count1: 0_u16,
29609 errors_count2: 0_u16,
29610 errors_count3: 0_u16,
29611 errors_count4: 0_u16,
29612 battery_remaining: 0_i8,
29613 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29614 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29615 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29616 };
29617 #[cfg(feature = "arbitrary")]
29618 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29619 use arbitrary::{Arbitrary, Unstructured};
29620 let mut buf = [0u8; 1024];
29621 rng.fill_bytes(&mut buf);
29622 let mut unstructured = Unstructured::new(&buf);
29623 Self::arbitrary(&mut unstructured).unwrap_or_default()
29624 }
29625}
29626impl Default for SYS_STATUS_DATA {
29627 fn default() -> Self {
29628 Self::DEFAULT.clone()
29629 }
29630}
29631impl MessageData for SYS_STATUS_DATA {
29632 type Message = MavMessage;
29633 const ID: u32 = 1u32;
29634 const NAME: &'static str = "SYS_STATUS";
29635 const EXTRA_CRC: u8 = 124u8;
29636 const ENCODED_LEN: usize = 43usize;
29637 fn deser(
29638 _version: MavlinkVersion,
29639 __input: &[u8],
29640 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29641 let avail_len = __input.len();
29642 let mut payload_buf = [0; Self::ENCODED_LEN];
29643 let mut buf = if avail_len < Self::ENCODED_LEN {
29644 payload_buf[0..avail_len].copy_from_slice(__input);
29645 Bytes::new(&payload_buf)
29646 } else {
29647 Bytes::new(__input)
29648 };
29649 let mut __struct = Self::default();
29650 let tmp = buf.get_u32_le();
29651 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
29652 tmp & MavSysStatusSensor::all().bits(),
29653 )
29654 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29655 flag_type: "MavSysStatusSensor",
29656 value: tmp as u32,
29657 })?;
29658 let tmp = buf.get_u32_le();
29659 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
29660 tmp & MavSysStatusSensor::all().bits(),
29661 )
29662 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29663 flag_type: "MavSysStatusSensor",
29664 value: tmp as u32,
29665 })?;
29666 let tmp = buf.get_u32_le();
29667 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
29668 tmp & MavSysStatusSensor::all().bits(),
29669 )
29670 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29671 flag_type: "MavSysStatusSensor",
29672 value: tmp as u32,
29673 })?;
29674 __struct.load = buf.get_u16_le();
29675 __struct.voltage_battery = buf.get_u16_le();
29676 __struct.current_battery = buf.get_i16_le();
29677 __struct.drop_rate_comm = buf.get_u16_le();
29678 __struct.errors_comm = buf.get_u16_le();
29679 __struct.errors_count1 = buf.get_u16_le();
29680 __struct.errors_count2 = buf.get_u16_le();
29681 __struct.errors_count3 = buf.get_u16_le();
29682 __struct.errors_count4 = buf.get_u16_le();
29683 __struct.battery_remaining = buf.get_i8();
29684 let tmp = buf.get_u32_le();
29685 __struct.onboard_control_sensors_present_extended =
29686 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29687 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29688 flag_type: "MavSysStatusSensorExtended",
29689 value: tmp as u32,
29690 })?;
29691 let tmp = buf.get_u32_le();
29692 __struct.onboard_control_sensors_enabled_extended =
29693 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29694 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29695 flag_type: "MavSysStatusSensorExtended",
29696 value: tmp as u32,
29697 })?;
29698 let tmp = buf.get_u32_le();
29699 __struct.onboard_control_sensors_health_extended =
29700 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29701 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29702 flag_type: "MavSysStatusSensorExtended",
29703 value: tmp as u32,
29704 })?;
29705 Ok(__struct)
29706 }
29707 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29708 let mut __tmp = BytesMut::new(bytes);
29709 #[allow(clippy::absurd_extreme_comparisons)]
29710 #[allow(unused_comparisons)]
29711 if __tmp.remaining() < Self::ENCODED_LEN {
29712 panic!(
29713 "buffer is too small (need {} bytes, but got {})",
29714 Self::ENCODED_LEN,
29715 __tmp.remaining(),
29716 )
29717 }
29718 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
29719 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
29720 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
29721 __tmp.put_u16_le(self.load);
29722 __tmp.put_u16_le(self.voltage_battery);
29723 __tmp.put_i16_le(self.current_battery);
29724 __tmp.put_u16_le(self.drop_rate_comm);
29725 __tmp.put_u16_le(self.errors_comm);
29726 __tmp.put_u16_le(self.errors_count1);
29727 __tmp.put_u16_le(self.errors_count2);
29728 __tmp.put_u16_le(self.errors_count3);
29729 __tmp.put_u16_le(self.errors_count4);
29730 __tmp.put_i8(self.battery_remaining);
29731 if matches!(version, MavlinkVersion::V2) {
29732 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
29733 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
29734 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
29735 let len = __tmp.len();
29736 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29737 } else {
29738 __tmp.len()
29739 }
29740 }
29741}
29742#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
29743#[doc = ""]
29744#[doc = "ID: 135"]
29745#[derive(Debug, Clone, PartialEq)]
29746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29748#[cfg_attr(feature = "ts", derive(TS))]
29749#[cfg_attr(feature = "ts", ts(export))]
29750pub struct TERRAIN_CHECK_DATA {
29751 #[doc = "Latitude"]
29752 pub lat: i32,
29753 #[doc = "Longitude"]
29754 pub lon: i32,
29755}
29756impl TERRAIN_CHECK_DATA {
29757 pub const ENCODED_LEN: usize = 8usize;
29758 pub const DEFAULT: Self = Self {
29759 lat: 0_i32,
29760 lon: 0_i32,
29761 };
29762 #[cfg(feature = "arbitrary")]
29763 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29764 use arbitrary::{Arbitrary, Unstructured};
29765 let mut buf = [0u8; 1024];
29766 rng.fill_bytes(&mut buf);
29767 let mut unstructured = Unstructured::new(&buf);
29768 Self::arbitrary(&mut unstructured).unwrap_or_default()
29769 }
29770}
29771impl Default for TERRAIN_CHECK_DATA {
29772 fn default() -> Self {
29773 Self::DEFAULT.clone()
29774 }
29775}
29776impl MessageData for TERRAIN_CHECK_DATA {
29777 type Message = MavMessage;
29778 const ID: u32 = 135u32;
29779 const NAME: &'static str = "TERRAIN_CHECK";
29780 const EXTRA_CRC: u8 = 203u8;
29781 const ENCODED_LEN: usize = 8usize;
29782 fn deser(
29783 _version: MavlinkVersion,
29784 __input: &[u8],
29785 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29786 let avail_len = __input.len();
29787 let mut payload_buf = [0; Self::ENCODED_LEN];
29788 let mut buf = if avail_len < Self::ENCODED_LEN {
29789 payload_buf[0..avail_len].copy_from_slice(__input);
29790 Bytes::new(&payload_buf)
29791 } else {
29792 Bytes::new(__input)
29793 };
29794 let mut __struct = Self::default();
29795 __struct.lat = buf.get_i32_le();
29796 __struct.lon = buf.get_i32_le();
29797 Ok(__struct)
29798 }
29799 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29800 let mut __tmp = BytesMut::new(bytes);
29801 #[allow(clippy::absurd_extreme_comparisons)]
29802 #[allow(unused_comparisons)]
29803 if __tmp.remaining() < Self::ENCODED_LEN {
29804 panic!(
29805 "buffer is too small (need {} bytes, but got {})",
29806 Self::ENCODED_LEN,
29807 __tmp.remaining(),
29808 )
29809 }
29810 __tmp.put_i32_le(self.lat);
29811 __tmp.put_i32_le(self.lon);
29812 if matches!(version, MavlinkVersion::V2) {
29813 let len = __tmp.len();
29814 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29815 } else {
29816 __tmp.len()
29817 }
29818 }
29819}
29820#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29821#[doc = ""]
29822#[doc = "ID: 134"]
29823#[derive(Debug, Clone, PartialEq)]
29824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29826#[cfg_attr(feature = "ts", derive(TS))]
29827#[cfg_attr(feature = "ts", ts(export))]
29828pub struct TERRAIN_DATA_DATA {
29829 #[doc = "Latitude of SW corner of first grid"]
29830 pub lat: i32,
29831 #[doc = "Longitude of SW corner of first grid"]
29832 pub lon: i32,
29833 #[doc = "Grid spacing"]
29834 pub grid_spacing: u16,
29835 #[doc = "Terrain data MSL"]
29836 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29837 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29838 pub data: [i16; 16],
29839 #[doc = "bit within the terrain request mask"]
29840 pub gridbit: u8,
29841}
29842impl TERRAIN_DATA_DATA {
29843 pub const ENCODED_LEN: usize = 43usize;
29844 pub const DEFAULT: Self = Self {
29845 lat: 0_i32,
29846 lon: 0_i32,
29847 grid_spacing: 0_u16,
29848 data: [0_i16; 16usize],
29849 gridbit: 0_u8,
29850 };
29851 #[cfg(feature = "arbitrary")]
29852 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29853 use arbitrary::{Arbitrary, Unstructured};
29854 let mut buf = [0u8; 1024];
29855 rng.fill_bytes(&mut buf);
29856 let mut unstructured = Unstructured::new(&buf);
29857 Self::arbitrary(&mut unstructured).unwrap_or_default()
29858 }
29859}
29860impl Default for TERRAIN_DATA_DATA {
29861 fn default() -> Self {
29862 Self::DEFAULT.clone()
29863 }
29864}
29865impl MessageData for TERRAIN_DATA_DATA {
29866 type Message = MavMessage;
29867 const ID: u32 = 134u32;
29868 const NAME: &'static str = "TERRAIN_DATA";
29869 const EXTRA_CRC: u8 = 229u8;
29870 const ENCODED_LEN: usize = 43usize;
29871 fn deser(
29872 _version: MavlinkVersion,
29873 __input: &[u8],
29874 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29875 let avail_len = __input.len();
29876 let mut payload_buf = [0; Self::ENCODED_LEN];
29877 let mut buf = if avail_len < Self::ENCODED_LEN {
29878 payload_buf[0..avail_len].copy_from_slice(__input);
29879 Bytes::new(&payload_buf)
29880 } else {
29881 Bytes::new(__input)
29882 };
29883 let mut __struct = Self::default();
29884 __struct.lat = buf.get_i32_le();
29885 __struct.lon = buf.get_i32_le();
29886 __struct.grid_spacing = buf.get_u16_le();
29887 for v in &mut __struct.data {
29888 let val = buf.get_i16_le();
29889 *v = val;
29890 }
29891 __struct.gridbit = buf.get_u8();
29892 Ok(__struct)
29893 }
29894 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29895 let mut __tmp = BytesMut::new(bytes);
29896 #[allow(clippy::absurd_extreme_comparisons)]
29897 #[allow(unused_comparisons)]
29898 if __tmp.remaining() < Self::ENCODED_LEN {
29899 panic!(
29900 "buffer is too small (need {} bytes, but got {})",
29901 Self::ENCODED_LEN,
29902 __tmp.remaining(),
29903 )
29904 }
29905 __tmp.put_i32_le(self.lat);
29906 __tmp.put_i32_le(self.lon);
29907 __tmp.put_u16_le(self.grid_spacing);
29908 for val in &self.data {
29909 __tmp.put_i16_le(*val);
29910 }
29911 __tmp.put_u8(self.gridbit);
29912 if matches!(version, MavlinkVersion::V2) {
29913 let len = __tmp.len();
29914 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29915 } else {
29916 __tmp.len()
29917 }
29918 }
29919}
29920#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29921#[doc = ""]
29922#[doc = "ID: 136"]
29923#[derive(Debug, Clone, PartialEq)]
29924#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29925#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29926#[cfg_attr(feature = "ts", derive(TS))]
29927#[cfg_attr(feature = "ts", ts(export))]
29928pub struct TERRAIN_REPORT_DATA {
29929 #[doc = "Latitude"]
29930 pub lat: i32,
29931 #[doc = "Longitude"]
29932 pub lon: i32,
29933 #[doc = "Terrain height MSL"]
29934 pub terrain_height: f32,
29935 #[doc = "Current vehicle height above lat/lon terrain height"]
29936 pub current_height: f32,
29937 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29938 pub spacing: u16,
29939 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29940 pub pending: u16,
29941 #[doc = "Number of 4x4 terrain blocks in memory"]
29942 pub loaded: u16,
29943}
29944impl TERRAIN_REPORT_DATA {
29945 pub const ENCODED_LEN: usize = 22usize;
29946 pub const DEFAULT: Self = Self {
29947 lat: 0_i32,
29948 lon: 0_i32,
29949 terrain_height: 0.0_f32,
29950 current_height: 0.0_f32,
29951 spacing: 0_u16,
29952 pending: 0_u16,
29953 loaded: 0_u16,
29954 };
29955 #[cfg(feature = "arbitrary")]
29956 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29957 use arbitrary::{Arbitrary, Unstructured};
29958 let mut buf = [0u8; 1024];
29959 rng.fill_bytes(&mut buf);
29960 let mut unstructured = Unstructured::new(&buf);
29961 Self::arbitrary(&mut unstructured).unwrap_or_default()
29962 }
29963}
29964impl Default for TERRAIN_REPORT_DATA {
29965 fn default() -> Self {
29966 Self::DEFAULT.clone()
29967 }
29968}
29969impl MessageData for TERRAIN_REPORT_DATA {
29970 type Message = MavMessage;
29971 const ID: u32 = 136u32;
29972 const NAME: &'static str = "TERRAIN_REPORT";
29973 const EXTRA_CRC: u8 = 1u8;
29974 const ENCODED_LEN: usize = 22usize;
29975 fn deser(
29976 _version: MavlinkVersion,
29977 __input: &[u8],
29978 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29979 let avail_len = __input.len();
29980 let mut payload_buf = [0; Self::ENCODED_LEN];
29981 let mut buf = if avail_len < Self::ENCODED_LEN {
29982 payload_buf[0..avail_len].copy_from_slice(__input);
29983 Bytes::new(&payload_buf)
29984 } else {
29985 Bytes::new(__input)
29986 };
29987 let mut __struct = Self::default();
29988 __struct.lat = buf.get_i32_le();
29989 __struct.lon = buf.get_i32_le();
29990 __struct.terrain_height = buf.get_f32_le();
29991 __struct.current_height = buf.get_f32_le();
29992 __struct.spacing = buf.get_u16_le();
29993 __struct.pending = buf.get_u16_le();
29994 __struct.loaded = buf.get_u16_le();
29995 Ok(__struct)
29996 }
29997 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29998 let mut __tmp = BytesMut::new(bytes);
29999 #[allow(clippy::absurd_extreme_comparisons)]
30000 #[allow(unused_comparisons)]
30001 if __tmp.remaining() < Self::ENCODED_LEN {
30002 panic!(
30003 "buffer is too small (need {} bytes, but got {})",
30004 Self::ENCODED_LEN,
30005 __tmp.remaining(),
30006 )
30007 }
30008 __tmp.put_i32_le(self.lat);
30009 __tmp.put_i32_le(self.lon);
30010 __tmp.put_f32_le(self.terrain_height);
30011 __tmp.put_f32_le(self.current_height);
30012 __tmp.put_u16_le(self.spacing);
30013 __tmp.put_u16_le(self.pending);
30014 __tmp.put_u16_le(self.loaded);
30015 if matches!(version, MavlinkVersion::V2) {
30016 let len = __tmp.len();
30017 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30018 } else {
30019 __tmp.len()
30020 }
30021 }
30022}
30023#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30024#[doc = ""]
30025#[doc = "ID: 133"]
30026#[derive(Debug, Clone, PartialEq)]
30027#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30028#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30029#[cfg_attr(feature = "ts", derive(TS))]
30030#[cfg_attr(feature = "ts", ts(export))]
30031pub struct TERRAIN_REQUEST_DATA {
30032 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
30033 pub mask: u64,
30034 #[doc = "Latitude of SW corner of first grid"]
30035 pub lat: i32,
30036 #[doc = "Longitude of SW corner of first grid"]
30037 pub lon: i32,
30038 #[doc = "Grid spacing"]
30039 pub grid_spacing: u16,
30040}
30041impl TERRAIN_REQUEST_DATA {
30042 pub const ENCODED_LEN: usize = 18usize;
30043 pub const DEFAULT: Self = Self {
30044 mask: 0_u64,
30045 lat: 0_i32,
30046 lon: 0_i32,
30047 grid_spacing: 0_u16,
30048 };
30049 #[cfg(feature = "arbitrary")]
30050 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30051 use arbitrary::{Arbitrary, Unstructured};
30052 let mut buf = [0u8; 1024];
30053 rng.fill_bytes(&mut buf);
30054 let mut unstructured = Unstructured::new(&buf);
30055 Self::arbitrary(&mut unstructured).unwrap_or_default()
30056 }
30057}
30058impl Default for TERRAIN_REQUEST_DATA {
30059 fn default() -> Self {
30060 Self::DEFAULT.clone()
30061 }
30062}
30063impl MessageData for TERRAIN_REQUEST_DATA {
30064 type Message = MavMessage;
30065 const ID: u32 = 133u32;
30066 const NAME: &'static str = "TERRAIN_REQUEST";
30067 const EXTRA_CRC: u8 = 6u8;
30068 const ENCODED_LEN: usize = 18usize;
30069 fn deser(
30070 _version: MavlinkVersion,
30071 __input: &[u8],
30072 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30073 let avail_len = __input.len();
30074 let mut payload_buf = [0; Self::ENCODED_LEN];
30075 let mut buf = if avail_len < Self::ENCODED_LEN {
30076 payload_buf[0..avail_len].copy_from_slice(__input);
30077 Bytes::new(&payload_buf)
30078 } else {
30079 Bytes::new(__input)
30080 };
30081 let mut __struct = Self::default();
30082 __struct.mask = buf.get_u64_le();
30083 __struct.lat = buf.get_i32_le();
30084 __struct.lon = buf.get_i32_le();
30085 __struct.grid_spacing = buf.get_u16_le();
30086 Ok(__struct)
30087 }
30088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30089 let mut __tmp = BytesMut::new(bytes);
30090 #[allow(clippy::absurd_extreme_comparisons)]
30091 #[allow(unused_comparisons)]
30092 if __tmp.remaining() < Self::ENCODED_LEN {
30093 panic!(
30094 "buffer is too small (need {} bytes, but got {})",
30095 Self::ENCODED_LEN,
30096 __tmp.remaining(),
30097 )
30098 }
30099 __tmp.put_u64_le(self.mask);
30100 __tmp.put_i32_le(self.lat);
30101 __tmp.put_i32_le(self.lon);
30102 __tmp.put_u16_le(self.grid_spacing);
30103 if matches!(version, MavlinkVersion::V2) {
30104 let len = __tmp.len();
30105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30106 } else {
30107 __tmp.len()
30108 }
30109 }
30110}
30111#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
30112#[doc = ""]
30113#[doc = "ID: 111"]
30114#[derive(Debug, Clone, PartialEq)]
30115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30117#[cfg_attr(feature = "ts", derive(TS))]
30118#[cfg_attr(feature = "ts", ts(export))]
30119pub struct TIMESYNC_DATA {
30120 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
30121 pub tc1: i64,
30122 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
30123 pub ts1: i64,
30124 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
30125 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30126 pub target_system: u8,
30127 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
30128 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30129 pub target_component: u8,
30130}
30131impl TIMESYNC_DATA {
30132 pub const ENCODED_LEN: usize = 18usize;
30133 pub const DEFAULT: Self = Self {
30134 tc1: 0_i64,
30135 ts1: 0_i64,
30136 target_system: 0_u8,
30137 target_component: 0_u8,
30138 };
30139 #[cfg(feature = "arbitrary")]
30140 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30141 use arbitrary::{Arbitrary, Unstructured};
30142 let mut buf = [0u8; 1024];
30143 rng.fill_bytes(&mut buf);
30144 let mut unstructured = Unstructured::new(&buf);
30145 Self::arbitrary(&mut unstructured).unwrap_or_default()
30146 }
30147}
30148impl Default for TIMESYNC_DATA {
30149 fn default() -> Self {
30150 Self::DEFAULT.clone()
30151 }
30152}
30153impl MessageData for TIMESYNC_DATA {
30154 type Message = MavMessage;
30155 const ID: u32 = 111u32;
30156 const NAME: &'static str = "TIMESYNC";
30157 const EXTRA_CRC: u8 = 34u8;
30158 const ENCODED_LEN: usize = 18usize;
30159 fn deser(
30160 _version: MavlinkVersion,
30161 __input: &[u8],
30162 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30163 let avail_len = __input.len();
30164 let mut payload_buf = [0; Self::ENCODED_LEN];
30165 let mut buf = if avail_len < Self::ENCODED_LEN {
30166 payload_buf[0..avail_len].copy_from_slice(__input);
30167 Bytes::new(&payload_buf)
30168 } else {
30169 Bytes::new(__input)
30170 };
30171 let mut __struct = Self::default();
30172 __struct.tc1 = buf.get_i64_le();
30173 __struct.ts1 = buf.get_i64_le();
30174 __struct.target_system = buf.get_u8();
30175 __struct.target_component = buf.get_u8();
30176 Ok(__struct)
30177 }
30178 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30179 let mut __tmp = BytesMut::new(bytes);
30180 #[allow(clippy::absurd_extreme_comparisons)]
30181 #[allow(unused_comparisons)]
30182 if __tmp.remaining() < Self::ENCODED_LEN {
30183 panic!(
30184 "buffer is too small (need {} bytes, but got {})",
30185 Self::ENCODED_LEN,
30186 __tmp.remaining(),
30187 )
30188 }
30189 __tmp.put_i64_le(self.tc1);
30190 __tmp.put_i64_le(self.ts1);
30191 if matches!(version, MavlinkVersion::V2) {
30192 __tmp.put_u8(self.target_system);
30193 __tmp.put_u8(self.target_component);
30194 let len = __tmp.len();
30195 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30196 } else {
30197 __tmp.len()
30198 }
30199 }
30200}
30201#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30202#[doc = ""]
30203#[doc = "ID: 380"]
30204#[derive(Debug, Clone, PartialEq)]
30205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30207#[cfg_attr(feature = "ts", derive(TS))]
30208#[cfg_attr(feature = "ts", ts(export))]
30209pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30210 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30211 pub safe_return: i32,
30212 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30213 pub land: i32,
30214 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30215 pub mission_next_item: i32,
30216 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30217 pub mission_end: i32,
30218 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30219 pub commanded_action: i32,
30220}
30221impl TIME_ESTIMATE_TO_TARGET_DATA {
30222 pub const ENCODED_LEN: usize = 20usize;
30223 pub const DEFAULT: Self = Self {
30224 safe_return: 0_i32,
30225 land: 0_i32,
30226 mission_next_item: 0_i32,
30227 mission_end: 0_i32,
30228 commanded_action: 0_i32,
30229 };
30230 #[cfg(feature = "arbitrary")]
30231 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30232 use arbitrary::{Arbitrary, Unstructured};
30233 let mut buf = [0u8; 1024];
30234 rng.fill_bytes(&mut buf);
30235 let mut unstructured = Unstructured::new(&buf);
30236 Self::arbitrary(&mut unstructured).unwrap_or_default()
30237 }
30238}
30239impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30240 fn default() -> Self {
30241 Self::DEFAULT.clone()
30242 }
30243}
30244impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30245 type Message = MavMessage;
30246 const ID: u32 = 380u32;
30247 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30248 const EXTRA_CRC: u8 = 232u8;
30249 const ENCODED_LEN: usize = 20usize;
30250 fn deser(
30251 _version: MavlinkVersion,
30252 __input: &[u8],
30253 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30254 let avail_len = __input.len();
30255 let mut payload_buf = [0; Self::ENCODED_LEN];
30256 let mut buf = if avail_len < Self::ENCODED_LEN {
30257 payload_buf[0..avail_len].copy_from_slice(__input);
30258 Bytes::new(&payload_buf)
30259 } else {
30260 Bytes::new(__input)
30261 };
30262 let mut __struct = Self::default();
30263 __struct.safe_return = buf.get_i32_le();
30264 __struct.land = buf.get_i32_le();
30265 __struct.mission_next_item = buf.get_i32_le();
30266 __struct.mission_end = buf.get_i32_le();
30267 __struct.commanded_action = buf.get_i32_le();
30268 Ok(__struct)
30269 }
30270 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30271 let mut __tmp = BytesMut::new(bytes);
30272 #[allow(clippy::absurd_extreme_comparisons)]
30273 #[allow(unused_comparisons)]
30274 if __tmp.remaining() < Self::ENCODED_LEN {
30275 panic!(
30276 "buffer is too small (need {} bytes, but got {})",
30277 Self::ENCODED_LEN,
30278 __tmp.remaining(),
30279 )
30280 }
30281 __tmp.put_i32_le(self.safe_return);
30282 __tmp.put_i32_le(self.land);
30283 __tmp.put_i32_le(self.mission_next_item);
30284 __tmp.put_i32_le(self.mission_end);
30285 __tmp.put_i32_le(self.commanded_action);
30286 if matches!(version, MavlinkVersion::V2) {
30287 let len = __tmp.len();
30288 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30289 } else {
30290 __tmp.len()
30291 }
30292 }
30293}
30294#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30295#[doc = ""]
30296#[doc = "ID: 333"]
30297#[derive(Debug, Clone, PartialEq)]
30298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30299#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30300#[cfg_attr(feature = "ts", derive(TS))]
30301#[cfg_attr(feature = "ts", ts(export))]
30302pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30303 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30304 pub time_usec: u64,
30305 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30306 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30307 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30308 pub pos_x: [f32; 5],
30309 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30310 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30311 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30312 pub pos_y: [f32; 5],
30313 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30314 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30315 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30316 pub pos_z: [f32; 5],
30317 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30318 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30319 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30320 pub delta: [f32; 5],
30321 #[doc = "Yaw. Set to NaN for unchanged"]
30322 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30323 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30324 pub pos_yaw: [f32; 5],
30325 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30326 pub valid_points: u8,
30327}
30328impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30329 pub const ENCODED_LEN: usize = 109usize;
30330 pub const DEFAULT: Self = Self {
30331 time_usec: 0_u64,
30332 pos_x: [0.0_f32; 5usize],
30333 pos_y: [0.0_f32; 5usize],
30334 pos_z: [0.0_f32; 5usize],
30335 delta: [0.0_f32; 5usize],
30336 pos_yaw: [0.0_f32; 5usize],
30337 valid_points: 0_u8,
30338 };
30339 #[cfg(feature = "arbitrary")]
30340 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30341 use arbitrary::{Arbitrary, Unstructured};
30342 let mut buf = [0u8; 1024];
30343 rng.fill_bytes(&mut buf);
30344 let mut unstructured = Unstructured::new(&buf);
30345 Self::arbitrary(&mut unstructured).unwrap_or_default()
30346 }
30347}
30348impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30349 fn default() -> Self {
30350 Self::DEFAULT.clone()
30351 }
30352}
30353impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30354 type Message = MavMessage;
30355 const ID: u32 = 333u32;
30356 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30357 const EXTRA_CRC: u8 = 231u8;
30358 const ENCODED_LEN: usize = 109usize;
30359 fn deser(
30360 _version: MavlinkVersion,
30361 __input: &[u8],
30362 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30363 let avail_len = __input.len();
30364 let mut payload_buf = [0; Self::ENCODED_LEN];
30365 let mut buf = if avail_len < Self::ENCODED_LEN {
30366 payload_buf[0..avail_len].copy_from_slice(__input);
30367 Bytes::new(&payload_buf)
30368 } else {
30369 Bytes::new(__input)
30370 };
30371 let mut __struct = Self::default();
30372 __struct.time_usec = buf.get_u64_le();
30373 for v in &mut __struct.pos_x {
30374 let val = buf.get_f32_le();
30375 *v = val;
30376 }
30377 for v in &mut __struct.pos_y {
30378 let val = buf.get_f32_le();
30379 *v = val;
30380 }
30381 for v in &mut __struct.pos_z {
30382 let val = buf.get_f32_le();
30383 *v = val;
30384 }
30385 for v in &mut __struct.delta {
30386 let val = buf.get_f32_le();
30387 *v = val;
30388 }
30389 for v in &mut __struct.pos_yaw {
30390 let val = buf.get_f32_le();
30391 *v = val;
30392 }
30393 __struct.valid_points = buf.get_u8();
30394 Ok(__struct)
30395 }
30396 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30397 let mut __tmp = BytesMut::new(bytes);
30398 #[allow(clippy::absurd_extreme_comparisons)]
30399 #[allow(unused_comparisons)]
30400 if __tmp.remaining() < Self::ENCODED_LEN {
30401 panic!(
30402 "buffer is too small (need {} bytes, but got {})",
30403 Self::ENCODED_LEN,
30404 __tmp.remaining(),
30405 )
30406 }
30407 __tmp.put_u64_le(self.time_usec);
30408 for val in &self.pos_x {
30409 __tmp.put_f32_le(*val);
30410 }
30411 for val in &self.pos_y {
30412 __tmp.put_f32_le(*val);
30413 }
30414 for val in &self.pos_z {
30415 __tmp.put_f32_le(*val);
30416 }
30417 for val in &self.delta {
30418 __tmp.put_f32_le(*val);
30419 }
30420 for val in &self.pos_yaw {
30421 __tmp.put_f32_le(*val);
30422 }
30423 __tmp.put_u8(self.valid_points);
30424 if matches!(version, MavlinkVersion::V2) {
30425 let len = __tmp.len();
30426 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30427 } else {
30428 __tmp.len()
30429 }
30430 }
30431}
30432#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30433#[doc = ""]
30434#[doc = "ID: 332"]
30435#[derive(Debug, Clone, PartialEq)]
30436#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30438#[cfg_attr(feature = "ts", derive(TS))]
30439#[cfg_attr(feature = "ts", ts(export))]
30440pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30441 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30442 pub time_usec: u64,
30443 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30444 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30445 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30446 pub pos_x: [f32; 5],
30447 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30448 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30449 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30450 pub pos_y: [f32; 5],
30451 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30452 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30453 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30454 pub pos_z: [f32; 5],
30455 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30456 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30457 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30458 pub vel_x: [f32; 5],
30459 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30460 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30461 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30462 pub vel_y: [f32; 5],
30463 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30464 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30465 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30466 pub vel_z: [f32; 5],
30467 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30468 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30469 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30470 pub acc_x: [f32; 5],
30471 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30472 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30473 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30474 pub acc_y: [f32; 5],
30475 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30476 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30477 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30478 pub acc_z: [f32; 5],
30479 #[doc = "Yaw angle, set to NaN if not being used"]
30480 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30481 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30482 pub pos_yaw: [f32; 5],
30483 #[doc = "Yaw rate, set to NaN if not being used"]
30484 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30485 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30486 pub vel_yaw: [f32; 5],
30487 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30488 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30489 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30490 pub command: [u16; 5],
30491 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30492 pub valid_points: u8,
30493}
30494impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30495 pub const ENCODED_LEN: usize = 239usize;
30496 pub const DEFAULT: Self = Self {
30497 time_usec: 0_u64,
30498 pos_x: [0.0_f32; 5usize],
30499 pos_y: [0.0_f32; 5usize],
30500 pos_z: [0.0_f32; 5usize],
30501 vel_x: [0.0_f32; 5usize],
30502 vel_y: [0.0_f32; 5usize],
30503 vel_z: [0.0_f32; 5usize],
30504 acc_x: [0.0_f32; 5usize],
30505 acc_y: [0.0_f32; 5usize],
30506 acc_z: [0.0_f32; 5usize],
30507 pos_yaw: [0.0_f32; 5usize],
30508 vel_yaw: [0.0_f32; 5usize],
30509 command: [0_u16; 5usize],
30510 valid_points: 0_u8,
30511 };
30512 #[cfg(feature = "arbitrary")]
30513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30514 use arbitrary::{Arbitrary, Unstructured};
30515 let mut buf = [0u8; 1024];
30516 rng.fill_bytes(&mut buf);
30517 let mut unstructured = Unstructured::new(&buf);
30518 Self::arbitrary(&mut unstructured).unwrap_or_default()
30519 }
30520}
30521impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30522 fn default() -> Self {
30523 Self::DEFAULT.clone()
30524 }
30525}
30526impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30527 type Message = MavMessage;
30528 const ID: u32 = 332u32;
30529 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30530 const EXTRA_CRC: u8 = 236u8;
30531 const ENCODED_LEN: usize = 239usize;
30532 fn deser(
30533 _version: MavlinkVersion,
30534 __input: &[u8],
30535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30536 let avail_len = __input.len();
30537 let mut payload_buf = [0; Self::ENCODED_LEN];
30538 let mut buf = if avail_len < Self::ENCODED_LEN {
30539 payload_buf[0..avail_len].copy_from_slice(__input);
30540 Bytes::new(&payload_buf)
30541 } else {
30542 Bytes::new(__input)
30543 };
30544 let mut __struct = Self::default();
30545 __struct.time_usec = buf.get_u64_le();
30546 for v in &mut __struct.pos_x {
30547 let val = buf.get_f32_le();
30548 *v = val;
30549 }
30550 for v in &mut __struct.pos_y {
30551 let val = buf.get_f32_le();
30552 *v = val;
30553 }
30554 for v in &mut __struct.pos_z {
30555 let val = buf.get_f32_le();
30556 *v = val;
30557 }
30558 for v in &mut __struct.vel_x {
30559 let val = buf.get_f32_le();
30560 *v = val;
30561 }
30562 for v in &mut __struct.vel_y {
30563 let val = buf.get_f32_le();
30564 *v = val;
30565 }
30566 for v in &mut __struct.vel_z {
30567 let val = buf.get_f32_le();
30568 *v = val;
30569 }
30570 for v in &mut __struct.acc_x {
30571 let val = buf.get_f32_le();
30572 *v = val;
30573 }
30574 for v in &mut __struct.acc_y {
30575 let val = buf.get_f32_le();
30576 *v = val;
30577 }
30578 for v in &mut __struct.acc_z {
30579 let val = buf.get_f32_le();
30580 *v = val;
30581 }
30582 for v in &mut __struct.pos_yaw {
30583 let val = buf.get_f32_le();
30584 *v = val;
30585 }
30586 for v in &mut __struct.vel_yaw {
30587 let val = buf.get_f32_le();
30588 *v = val;
30589 }
30590 for v in &mut __struct.command {
30591 let val = buf.get_u16_le();
30592 *v = val;
30593 }
30594 __struct.valid_points = buf.get_u8();
30595 Ok(__struct)
30596 }
30597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30598 let mut __tmp = BytesMut::new(bytes);
30599 #[allow(clippy::absurd_extreme_comparisons)]
30600 #[allow(unused_comparisons)]
30601 if __tmp.remaining() < Self::ENCODED_LEN {
30602 panic!(
30603 "buffer is too small (need {} bytes, but got {})",
30604 Self::ENCODED_LEN,
30605 __tmp.remaining(),
30606 )
30607 }
30608 __tmp.put_u64_le(self.time_usec);
30609 for val in &self.pos_x {
30610 __tmp.put_f32_le(*val);
30611 }
30612 for val in &self.pos_y {
30613 __tmp.put_f32_le(*val);
30614 }
30615 for val in &self.pos_z {
30616 __tmp.put_f32_le(*val);
30617 }
30618 for val in &self.vel_x {
30619 __tmp.put_f32_le(*val);
30620 }
30621 for val in &self.vel_y {
30622 __tmp.put_f32_le(*val);
30623 }
30624 for val in &self.vel_z {
30625 __tmp.put_f32_le(*val);
30626 }
30627 for val in &self.acc_x {
30628 __tmp.put_f32_le(*val);
30629 }
30630 for val in &self.acc_y {
30631 __tmp.put_f32_le(*val);
30632 }
30633 for val in &self.acc_z {
30634 __tmp.put_f32_le(*val);
30635 }
30636 for val in &self.pos_yaw {
30637 __tmp.put_f32_le(*val);
30638 }
30639 for val in &self.vel_yaw {
30640 __tmp.put_f32_le(*val);
30641 }
30642 for val in &self.command {
30643 __tmp.put_u16_le(*val);
30644 }
30645 __tmp.put_u8(self.valid_points);
30646 if matches!(version, MavlinkVersion::V2) {
30647 let len = __tmp.len();
30648 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30649 } else {
30650 __tmp.len()
30651 }
30652 }
30653}
30654#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30655#[doc = ""]
30656#[doc = "ID: 385"]
30657#[derive(Debug, Clone, PartialEq)]
30658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30660#[cfg_attr(feature = "ts", derive(TS))]
30661#[cfg_attr(feature = "ts", ts(export))]
30662pub struct TUNNEL_DATA {
30663 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30664 pub payload_type: MavTunnelPayloadType,
30665 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30666 pub target_system: u8,
30667 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30668 pub target_component: u8,
30669 #[doc = "Length of the data transported in payload"]
30670 pub payload_length: u8,
30671 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30672 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30673 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30674 pub payload: [u8; 128],
30675}
30676impl TUNNEL_DATA {
30677 pub const ENCODED_LEN: usize = 133usize;
30678 pub const DEFAULT: Self = Self {
30679 payload_type: MavTunnelPayloadType::DEFAULT,
30680 target_system: 0_u8,
30681 target_component: 0_u8,
30682 payload_length: 0_u8,
30683 payload: [0_u8; 128usize],
30684 };
30685 #[cfg(feature = "arbitrary")]
30686 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30687 use arbitrary::{Arbitrary, Unstructured};
30688 let mut buf = [0u8; 1024];
30689 rng.fill_bytes(&mut buf);
30690 let mut unstructured = Unstructured::new(&buf);
30691 Self::arbitrary(&mut unstructured).unwrap_or_default()
30692 }
30693}
30694impl Default for TUNNEL_DATA {
30695 fn default() -> Self {
30696 Self::DEFAULT.clone()
30697 }
30698}
30699impl MessageData for TUNNEL_DATA {
30700 type Message = MavMessage;
30701 const ID: u32 = 385u32;
30702 const NAME: &'static str = "TUNNEL";
30703 const EXTRA_CRC: u8 = 147u8;
30704 const ENCODED_LEN: usize = 133usize;
30705 fn deser(
30706 _version: MavlinkVersion,
30707 __input: &[u8],
30708 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30709 let avail_len = __input.len();
30710 let mut payload_buf = [0; Self::ENCODED_LEN];
30711 let mut buf = if avail_len < Self::ENCODED_LEN {
30712 payload_buf[0..avail_len].copy_from_slice(__input);
30713 Bytes::new(&payload_buf)
30714 } else {
30715 Bytes::new(__input)
30716 };
30717 let mut __struct = Self::default();
30718 let tmp = buf.get_u16_le();
30719 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30720 ::mavlink_core::error::ParserError::InvalidEnum {
30721 enum_type: "MavTunnelPayloadType",
30722 value: tmp as u32,
30723 },
30724 )?;
30725 __struct.target_system = buf.get_u8();
30726 __struct.target_component = buf.get_u8();
30727 __struct.payload_length = buf.get_u8();
30728 for v in &mut __struct.payload {
30729 let val = buf.get_u8();
30730 *v = val;
30731 }
30732 Ok(__struct)
30733 }
30734 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30735 let mut __tmp = BytesMut::new(bytes);
30736 #[allow(clippy::absurd_extreme_comparisons)]
30737 #[allow(unused_comparisons)]
30738 if __tmp.remaining() < Self::ENCODED_LEN {
30739 panic!(
30740 "buffer is too small (need {} bytes, but got {})",
30741 Self::ENCODED_LEN,
30742 __tmp.remaining(),
30743 )
30744 }
30745 __tmp.put_u16_le(self.payload_type as u16);
30746 __tmp.put_u8(self.target_system);
30747 __tmp.put_u8(self.target_component);
30748 __tmp.put_u8(self.payload_length);
30749 for val in &self.payload {
30750 __tmp.put_u8(*val);
30751 }
30752 if matches!(version, MavlinkVersion::V2) {
30753 let len = __tmp.len();
30754 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30755 } else {
30756 __tmp.len()
30757 }
30758 }
30759}
30760#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
30761#[doc = ""]
30762#[doc = "ID: 311"]
30763#[derive(Debug, Clone, PartialEq)]
30764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30766#[cfg_attr(feature = "ts", derive(TS))]
30767#[cfg_attr(feature = "ts", ts(export))]
30768pub struct UAVCAN_NODE_INFO_DATA {
30769 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30770 pub time_usec: u64,
30771 #[doc = "Time since the start-up of the node."]
30772 pub uptime_sec: u32,
30773 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
30774 pub sw_vcs_commit: u32,
30775 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
30776 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30777 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30778 pub name: [u8; 80],
30779 #[doc = "Hardware major version number."]
30780 pub hw_version_major: u8,
30781 #[doc = "Hardware minor version number."]
30782 pub hw_version_minor: u8,
30783 #[doc = "Hardware unique 128-bit ID."]
30784 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30785 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30786 pub hw_unique_id: [u8; 16],
30787 #[doc = "Software major version number."]
30788 pub sw_version_major: u8,
30789 #[doc = "Software minor version number."]
30790 pub sw_version_minor: u8,
30791}
30792impl UAVCAN_NODE_INFO_DATA {
30793 pub const ENCODED_LEN: usize = 116usize;
30794 pub const DEFAULT: Self = Self {
30795 time_usec: 0_u64,
30796 uptime_sec: 0_u32,
30797 sw_vcs_commit: 0_u32,
30798 name: [0_u8; 80usize],
30799 hw_version_major: 0_u8,
30800 hw_version_minor: 0_u8,
30801 hw_unique_id: [0_u8; 16usize],
30802 sw_version_major: 0_u8,
30803 sw_version_minor: 0_u8,
30804 };
30805 #[cfg(feature = "arbitrary")]
30806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30807 use arbitrary::{Arbitrary, Unstructured};
30808 let mut buf = [0u8; 1024];
30809 rng.fill_bytes(&mut buf);
30810 let mut unstructured = Unstructured::new(&buf);
30811 Self::arbitrary(&mut unstructured).unwrap_or_default()
30812 }
30813}
30814impl Default for UAVCAN_NODE_INFO_DATA {
30815 fn default() -> Self {
30816 Self::DEFAULT.clone()
30817 }
30818}
30819impl MessageData for UAVCAN_NODE_INFO_DATA {
30820 type Message = MavMessage;
30821 const ID: u32 = 311u32;
30822 const NAME: &'static str = "UAVCAN_NODE_INFO";
30823 const EXTRA_CRC: u8 = 95u8;
30824 const ENCODED_LEN: usize = 116usize;
30825 fn deser(
30826 _version: MavlinkVersion,
30827 __input: &[u8],
30828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30829 let avail_len = __input.len();
30830 let mut payload_buf = [0; Self::ENCODED_LEN];
30831 let mut buf = if avail_len < Self::ENCODED_LEN {
30832 payload_buf[0..avail_len].copy_from_slice(__input);
30833 Bytes::new(&payload_buf)
30834 } else {
30835 Bytes::new(__input)
30836 };
30837 let mut __struct = Self::default();
30838 __struct.time_usec = buf.get_u64_le();
30839 __struct.uptime_sec = buf.get_u32_le();
30840 __struct.sw_vcs_commit = buf.get_u32_le();
30841 for v in &mut __struct.name {
30842 let val = buf.get_u8();
30843 *v = val;
30844 }
30845 __struct.hw_version_major = buf.get_u8();
30846 __struct.hw_version_minor = buf.get_u8();
30847 for v in &mut __struct.hw_unique_id {
30848 let val = buf.get_u8();
30849 *v = val;
30850 }
30851 __struct.sw_version_major = buf.get_u8();
30852 __struct.sw_version_minor = buf.get_u8();
30853 Ok(__struct)
30854 }
30855 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30856 let mut __tmp = BytesMut::new(bytes);
30857 #[allow(clippy::absurd_extreme_comparisons)]
30858 #[allow(unused_comparisons)]
30859 if __tmp.remaining() < Self::ENCODED_LEN {
30860 panic!(
30861 "buffer is too small (need {} bytes, but got {})",
30862 Self::ENCODED_LEN,
30863 __tmp.remaining(),
30864 )
30865 }
30866 __tmp.put_u64_le(self.time_usec);
30867 __tmp.put_u32_le(self.uptime_sec);
30868 __tmp.put_u32_le(self.sw_vcs_commit);
30869 for val in &self.name {
30870 __tmp.put_u8(*val);
30871 }
30872 __tmp.put_u8(self.hw_version_major);
30873 __tmp.put_u8(self.hw_version_minor);
30874 for val in &self.hw_unique_id {
30875 __tmp.put_u8(*val);
30876 }
30877 __tmp.put_u8(self.sw_version_major);
30878 __tmp.put_u8(self.sw_version_minor);
30879 if matches!(version, MavlinkVersion::V2) {
30880 let len = __tmp.len();
30881 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30882 } else {
30883 __tmp.len()
30884 }
30885 }
30886}
30887#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30888#[doc = ""]
30889#[doc = "ID: 310"]
30890#[derive(Debug, Clone, PartialEq)]
30891#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30892#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30893#[cfg_attr(feature = "ts", derive(TS))]
30894#[cfg_attr(feature = "ts", ts(export))]
30895pub struct UAVCAN_NODE_STATUS_DATA {
30896 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30897 pub time_usec: u64,
30898 #[doc = "Time since the start-up of the node."]
30899 pub uptime_sec: u32,
30900 #[doc = "Vendor-specific status information."]
30901 pub vendor_specific_status_code: u16,
30902 #[doc = "Generalized node health status."]
30903 pub health: UavcanNodeHealth,
30904 #[doc = "Generalized operating mode."]
30905 pub mode: UavcanNodeMode,
30906 #[doc = "Not used currently."]
30907 pub sub_mode: u8,
30908}
30909impl UAVCAN_NODE_STATUS_DATA {
30910 pub const ENCODED_LEN: usize = 17usize;
30911 pub const DEFAULT: Self = Self {
30912 time_usec: 0_u64,
30913 uptime_sec: 0_u32,
30914 vendor_specific_status_code: 0_u16,
30915 health: UavcanNodeHealth::DEFAULT,
30916 mode: UavcanNodeMode::DEFAULT,
30917 sub_mode: 0_u8,
30918 };
30919 #[cfg(feature = "arbitrary")]
30920 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30921 use arbitrary::{Arbitrary, Unstructured};
30922 let mut buf = [0u8; 1024];
30923 rng.fill_bytes(&mut buf);
30924 let mut unstructured = Unstructured::new(&buf);
30925 Self::arbitrary(&mut unstructured).unwrap_or_default()
30926 }
30927}
30928impl Default for UAVCAN_NODE_STATUS_DATA {
30929 fn default() -> Self {
30930 Self::DEFAULT.clone()
30931 }
30932}
30933impl MessageData for UAVCAN_NODE_STATUS_DATA {
30934 type Message = MavMessage;
30935 const ID: u32 = 310u32;
30936 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30937 const EXTRA_CRC: u8 = 28u8;
30938 const ENCODED_LEN: usize = 17usize;
30939 fn deser(
30940 _version: MavlinkVersion,
30941 __input: &[u8],
30942 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30943 let avail_len = __input.len();
30944 let mut payload_buf = [0; Self::ENCODED_LEN];
30945 let mut buf = if avail_len < Self::ENCODED_LEN {
30946 payload_buf[0..avail_len].copy_from_slice(__input);
30947 Bytes::new(&payload_buf)
30948 } else {
30949 Bytes::new(__input)
30950 };
30951 let mut __struct = Self::default();
30952 __struct.time_usec = buf.get_u64_le();
30953 __struct.uptime_sec = buf.get_u32_le();
30954 __struct.vendor_specific_status_code = buf.get_u16_le();
30955 let tmp = buf.get_u8();
30956 __struct.health =
30957 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30958 enum_type: "UavcanNodeHealth",
30959 value: tmp as u32,
30960 })?;
30961 let tmp = buf.get_u8();
30962 __struct.mode =
30963 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30964 enum_type: "UavcanNodeMode",
30965 value: tmp as u32,
30966 })?;
30967 __struct.sub_mode = buf.get_u8();
30968 Ok(__struct)
30969 }
30970 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30971 let mut __tmp = BytesMut::new(bytes);
30972 #[allow(clippy::absurd_extreme_comparisons)]
30973 #[allow(unused_comparisons)]
30974 if __tmp.remaining() < Self::ENCODED_LEN {
30975 panic!(
30976 "buffer is too small (need {} bytes, but got {})",
30977 Self::ENCODED_LEN,
30978 __tmp.remaining(),
30979 )
30980 }
30981 __tmp.put_u64_le(self.time_usec);
30982 __tmp.put_u32_le(self.uptime_sec);
30983 __tmp.put_u16_le(self.vendor_specific_status_code);
30984 __tmp.put_u8(self.health as u8);
30985 __tmp.put_u8(self.mode as u8);
30986 __tmp.put_u8(self.sub_mode);
30987 if matches!(version, MavlinkVersion::V2) {
30988 let len = __tmp.len();
30989 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30990 } else {
30991 __tmp.len()
30992 }
30993 }
30994}
30995#[doc = "The global position resulting from GPS and sensor fusion."]
30996#[doc = ""]
30997#[doc = "ID: 340"]
30998#[derive(Debug, Clone, PartialEq)]
30999#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31000#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31001#[cfg_attr(feature = "ts", derive(TS))]
31002#[cfg_attr(feature = "ts", ts(export))]
31003pub struct UTM_GLOBAL_POSITION_DATA {
31004 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
31005 pub time: u64,
31006 #[doc = "Latitude (WGS84)"]
31007 pub lat: i32,
31008 #[doc = "Longitude (WGS84)"]
31009 pub lon: i32,
31010 #[doc = "Altitude (WGS84)"]
31011 pub alt: i32,
31012 #[doc = "Altitude above ground"]
31013 pub relative_alt: i32,
31014 #[doc = "Next waypoint, latitude (WGS84)"]
31015 pub next_lat: i32,
31016 #[doc = "Next waypoint, longitude (WGS84)"]
31017 pub next_lon: i32,
31018 #[doc = "Next waypoint, altitude (WGS84)"]
31019 pub next_alt: i32,
31020 #[doc = "Ground X speed (latitude, positive north)"]
31021 pub vx: i16,
31022 #[doc = "Ground Y speed (longitude, positive east)"]
31023 pub vy: i16,
31024 #[doc = "Ground Z speed (altitude, positive down)"]
31025 pub vz: i16,
31026 #[doc = "Horizontal position uncertainty (standard deviation)"]
31027 pub h_acc: u16,
31028 #[doc = "Altitude uncertainty (standard deviation)"]
31029 pub v_acc: u16,
31030 #[doc = "Speed uncertainty (standard deviation)"]
31031 pub vel_acc: u16,
31032 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
31033 pub update_rate: u16,
31034 #[doc = "Unique UAS ID."]
31035 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31036 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31037 pub uas_id: [u8; 18],
31038 #[doc = "Flight state"]
31039 pub flight_state: UtmFlightState,
31040 #[doc = "Bitwise OR combination of the data available flags."]
31041 pub flags: UtmDataAvailFlags,
31042}
31043impl UTM_GLOBAL_POSITION_DATA {
31044 pub const ENCODED_LEN: usize = 70usize;
31045 pub const DEFAULT: Self = Self {
31046 time: 0_u64,
31047 lat: 0_i32,
31048 lon: 0_i32,
31049 alt: 0_i32,
31050 relative_alt: 0_i32,
31051 next_lat: 0_i32,
31052 next_lon: 0_i32,
31053 next_alt: 0_i32,
31054 vx: 0_i16,
31055 vy: 0_i16,
31056 vz: 0_i16,
31057 h_acc: 0_u16,
31058 v_acc: 0_u16,
31059 vel_acc: 0_u16,
31060 update_rate: 0_u16,
31061 uas_id: [0_u8; 18usize],
31062 flight_state: UtmFlightState::DEFAULT,
31063 flags: UtmDataAvailFlags::DEFAULT,
31064 };
31065 #[cfg(feature = "arbitrary")]
31066 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31067 use arbitrary::{Arbitrary, Unstructured};
31068 let mut buf = [0u8; 1024];
31069 rng.fill_bytes(&mut buf);
31070 let mut unstructured = Unstructured::new(&buf);
31071 Self::arbitrary(&mut unstructured).unwrap_or_default()
31072 }
31073}
31074impl Default for UTM_GLOBAL_POSITION_DATA {
31075 fn default() -> Self {
31076 Self::DEFAULT.clone()
31077 }
31078}
31079impl MessageData for UTM_GLOBAL_POSITION_DATA {
31080 type Message = MavMessage;
31081 const ID: u32 = 340u32;
31082 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31083 const EXTRA_CRC: u8 = 99u8;
31084 const ENCODED_LEN: usize = 70usize;
31085 fn deser(
31086 _version: MavlinkVersion,
31087 __input: &[u8],
31088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31089 let avail_len = __input.len();
31090 let mut payload_buf = [0; Self::ENCODED_LEN];
31091 let mut buf = if avail_len < Self::ENCODED_LEN {
31092 payload_buf[0..avail_len].copy_from_slice(__input);
31093 Bytes::new(&payload_buf)
31094 } else {
31095 Bytes::new(__input)
31096 };
31097 let mut __struct = Self::default();
31098 __struct.time = buf.get_u64_le();
31099 __struct.lat = buf.get_i32_le();
31100 __struct.lon = buf.get_i32_le();
31101 __struct.alt = buf.get_i32_le();
31102 __struct.relative_alt = buf.get_i32_le();
31103 __struct.next_lat = buf.get_i32_le();
31104 __struct.next_lon = buf.get_i32_le();
31105 __struct.next_alt = buf.get_i32_le();
31106 __struct.vx = buf.get_i16_le();
31107 __struct.vy = buf.get_i16_le();
31108 __struct.vz = buf.get_i16_le();
31109 __struct.h_acc = buf.get_u16_le();
31110 __struct.v_acc = buf.get_u16_le();
31111 __struct.vel_acc = buf.get_u16_le();
31112 __struct.update_rate = buf.get_u16_le();
31113 for v in &mut __struct.uas_id {
31114 let val = buf.get_u8();
31115 *v = val;
31116 }
31117 let tmp = buf.get_u8();
31118 __struct.flight_state =
31119 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31120 enum_type: "UtmFlightState",
31121 value: tmp as u32,
31122 })?;
31123 let tmp = buf.get_u8();
31124 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
31125 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31126 flag_type: "UtmDataAvailFlags",
31127 value: tmp as u32,
31128 })?;
31129 Ok(__struct)
31130 }
31131 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31132 let mut __tmp = BytesMut::new(bytes);
31133 #[allow(clippy::absurd_extreme_comparisons)]
31134 #[allow(unused_comparisons)]
31135 if __tmp.remaining() < Self::ENCODED_LEN {
31136 panic!(
31137 "buffer is too small (need {} bytes, but got {})",
31138 Self::ENCODED_LEN,
31139 __tmp.remaining(),
31140 )
31141 }
31142 __tmp.put_u64_le(self.time);
31143 __tmp.put_i32_le(self.lat);
31144 __tmp.put_i32_le(self.lon);
31145 __tmp.put_i32_le(self.alt);
31146 __tmp.put_i32_le(self.relative_alt);
31147 __tmp.put_i32_le(self.next_lat);
31148 __tmp.put_i32_le(self.next_lon);
31149 __tmp.put_i32_le(self.next_alt);
31150 __tmp.put_i16_le(self.vx);
31151 __tmp.put_i16_le(self.vy);
31152 __tmp.put_i16_le(self.vz);
31153 __tmp.put_u16_le(self.h_acc);
31154 __tmp.put_u16_le(self.v_acc);
31155 __tmp.put_u16_le(self.vel_acc);
31156 __tmp.put_u16_le(self.update_rate);
31157 for val in &self.uas_id {
31158 __tmp.put_u8(*val);
31159 }
31160 __tmp.put_u8(self.flight_state as u8);
31161 __tmp.put_u8(self.flags.bits());
31162 if matches!(version, MavlinkVersion::V2) {
31163 let len = __tmp.len();
31164 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31165 } else {
31166 __tmp.len()
31167 }
31168 }
31169}
31170#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31171#[doc = ""]
31172#[doc = "ID: 248"]
31173#[derive(Debug, Clone, PartialEq)]
31174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31176#[cfg_attr(feature = "ts", derive(TS))]
31177#[cfg_attr(feature = "ts", ts(export))]
31178pub struct V2_EXTENSION_DATA {
31179 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31180 pub message_type: u16,
31181 #[doc = "Network ID (0 for broadcast)"]
31182 pub target_network: u8,
31183 #[doc = "System ID (0 for broadcast)"]
31184 pub target_system: u8,
31185 #[doc = "Component ID (0 for broadcast)"]
31186 pub target_component: u8,
31187 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31189 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31190 pub payload: [u8; 249],
31191}
31192impl V2_EXTENSION_DATA {
31193 pub const ENCODED_LEN: usize = 254usize;
31194 pub const DEFAULT: Self = Self {
31195 message_type: 0_u16,
31196 target_network: 0_u8,
31197 target_system: 0_u8,
31198 target_component: 0_u8,
31199 payload: [0_u8; 249usize],
31200 };
31201 #[cfg(feature = "arbitrary")]
31202 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31203 use arbitrary::{Arbitrary, Unstructured};
31204 let mut buf = [0u8; 1024];
31205 rng.fill_bytes(&mut buf);
31206 let mut unstructured = Unstructured::new(&buf);
31207 Self::arbitrary(&mut unstructured).unwrap_or_default()
31208 }
31209}
31210impl Default for V2_EXTENSION_DATA {
31211 fn default() -> Self {
31212 Self::DEFAULT.clone()
31213 }
31214}
31215impl MessageData for V2_EXTENSION_DATA {
31216 type Message = MavMessage;
31217 const ID: u32 = 248u32;
31218 const NAME: &'static str = "V2_EXTENSION";
31219 const EXTRA_CRC: u8 = 8u8;
31220 const ENCODED_LEN: usize = 254usize;
31221 fn deser(
31222 _version: MavlinkVersion,
31223 __input: &[u8],
31224 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31225 let avail_len = __input.len();
31226 let mut payload_buf = [0; Self::ENCODED_LEN];
31227 let mut buf = if avail_len < Self::ENCODED_LEN {
31228 payload_buf[0..avail_len].copy_from_slice(__input);
31229 Bytes::new(&payload_buf)
31230 } else {
31231 Bytes::new(__input)
31232 };
31233 let mut __struct = Self::default();
31234 __struct.message_type = buf.get_u16_le();
31235 __struct.target_network = buf.get_u8();
31236 __struct.target_system = buf.get_u8();
31237 __struct.target_component = buf.get_u8();
31238 for v in &mut __struct.payload {
31239 let val = buf.get_u8();
31240 *v = val;
31241 }
31242 Ok(__struct)
31243 }
31244 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31245 let mut __tmp = BytesMut::new(bytes);
31246 #[allow(clippy::absurd_extreme_comparisons)]
31247 #[allow(unused_comparisons)]
31248 if __tmp.remaining() < Self::ENCODED_LEN {
31249 panic!(
31250 "buffer is too small (need {} bytes, but got {})",
31251 Self::ENCODED_LEN,
31252 __tmp.remaining(),
31253 )
31254 }
31255 __tmp.put_u16_le(self.message_type);
31256 __tmp.put_u8(self.target_network);
31257 __tmp.put_u8(self.target_system);
31258 __tmp.put_u8(self.target_component);
31259 for val in &self.payload {
31260 __tmp.put_u8(*val);
31261 }
31262 if matches!(version, MavlinkVersion::V2) {
31263 let len = __tmp.len();
31264 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31265 } else {
31266 __tmp.len()
31267 }
31268 }
31269}
31270#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31271#[doc = ""]
31272#[doc = "ID: 74"]
31273#[derive(Debug, Clone, PartialEq)]
31274#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31275#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31276#[cfg_attr(feature = "ts", derive(TS))]
31277#[cfg_attr(feature = "ts", ts(export))]
31278pub struct VFR_HUD_DATA {
31279 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31280 pub airspeed: f32,
31281 #[doc = "Current ground speed."]
31282 pub groundspeed: f32,
31283 #[doc = "Current altitude (MSL)."]
31284 pub alt: f32,
31285 #[doc = "Current climb rate."]
31286 pub climb: f32,
31287 #[doc = "Current heading in compass units (0-360, 0=north)."]
31288 pub heading: i16,
31289 #[doc = "Current throttle setting (0 to 100)."]
31290 pub throttle: u16,
31291}
31292impl VFR_HUD_DATA {
31293 pub const ENCODED_LEN: usize = 20usize;
31294 pub const DEFAULT: Self = Self {
31295 airspeed: 0.0_f32,
31296 groundspeed: 0.0_f32,
31297 alt: 0.0_f32,
31298 climb: 0.0_f32,
31299 heading: 0_i16,
31300 throttle: 0_u16,
31301 };
31302 #[cfg(feature = "arbitrary")]
31303 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31304 use arbitrary::{Arbitrary, Unstructured};
31305 let mut buf = [0u8; 1024];
31306 rng.fill_bytes(&mut buf);
31307 let mut unstructured = Unstructured::new(&buf);
31308 Self::arbitrary(&mut unstructured).unwrap_or_default()
31309 }
31310}
31311impl Default for VFR_HUD_DATA {
31312 fn default() -> Self {
31313 Self::DEFAULT.clone()
31314 }
31315}
31316impl MessageData for VFR_HUD_DATA {
31317 type Message = MavMessage;
31318 const ID: u32 = 74u32;
31319 const NAME: &'static str = "VFR_HUD";
31320 const EXTRA_CRC: u8 = 20u8;
31321 const ENCODED_LEN: usize = 20usize;
31322 fn deser(
31323 _version: MavlinkVersion,
31324 __input: &[u8],
31325 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31326 let avail_len = __input.len();
31327 let mut payload_buf = [0; Self::ENCODED_LEN];
31328 let mut buf = if avail_len < Self::ENCODED_LEN {
31329 payload_buf[0..avail_len].copy_from_slice(__input);
31330 Bytes::new(&payload_buf)
31331 } else {
31332 Bytes::new(__input)
31333 };
31334 let mut __struct = Self::default();
31335 __struct.airspeed = buf.get_f32_le();
31336 __struct.groundspeed = buf.get_f32_le();
31337 __struct.alt = buf.get_f32_le();
31338 __struct.climb = buf.get_f32_le();
31339 __struct.heading = buf.get_i16_le();
31340 __struct.throttle = buf.get_u16_le();
31341 Ok(__struct)
31342 }
31343 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31344 let mut __tmp = BytesMut::new(bytes);
31345 #[allow(clippy::absurd_extreme_comparisons)]
31346 #[allow(unused_comparisons)]
31347 if __tmp.remaining() < Self::ENCODED_LEN {
31348 panic!(
31349 "buffer is too small (need {} bytes, but got {})",
31350 Self::ENCODED_LEN,
31351 __tmp.remaining(),
31352 )
31353 }
31354 __tmp.put_f32_le(self.airspeed);
31355 __tmp.put_f32_le(self.groundspeed);
31356 __tmp.put_f32_le(self.alt);
31357 __tmp.put_f32_le(self.climb);
31358 __tmp.put_i16_le(self.heading);
31359 __tmp.put_u16_le(self.throttle);
31360 if matches!(version, MavlinkVersion::V2) {
31361 let len = __tmp.len();
31362 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31363 } else {
31364 __tmp.len()
31365 }
31366 }
31367}
31368#[doc = "Vibration levels and accelerometer clipping."]
31369#[doc = ""]
31370#[doc = "ID: 241"]
31371#[derive(Debug, Clone, PartialEq)]
31372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31374#[cfg_attr(feature = "ts", derive(TS))]
31375#[cfg_attr(feature = "ts", ts(export))]
31376pub struct VIBRATION_DATA {
31377 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31378 pub time_usec: u64,
31379 #[doc = "Vibration levels on X-axis"]
31380 pub vibration_x: f32,
31381 #[doc = "Vibration levels on Y-axis"]
31382 pub vibration_y: f32,
31383 #[doc = "Vibration levels on Z-axis"]
31384 pub vibration_z: f32,
31385 #[doc = "first accelerometer clipping count"]
31386 pub clipping_0: u32,
31387 #[doc = "second accelerometer clipping count"]
31388 pub clipping_1: u32,
31389 #[doc = "third accelerometer clipping count"]
31390 pub clipping_2: u32,
31391}
31392impl VIBRATION_DATA {
31393 pub const ENCODED_LEN: usize = 32usize;
31394 pub const DEFAULT: Self = Self {
31395 time_usec: 0_u64,
31396 vibration_x: 0.0_f32,
31397 vibration_y: 0.0_f32,
31398 vibration_z: 0.0_f32,
31399 clipping_0: 0_u32,
31400 clipping_1: 0_u32,
31401 clipping_2: 0_u32,
31402 };
31403 #[cfg(feature = "arbitrary")]
31404 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31405 use arbitrary::{Arbitrary, Unstructured};
31406 let mut buf = [0u8; 1024];
31407 rng.fill_bytes(&mut buf);
31408 let mut unstructured = Unstructured::new(&buf);
31409 Self::arbitrary(&mut unstructured).unwrap_or_default()
31410 }
31411}
31412impl Default for VIBRATION_DATA {
31413 fn default() -> Self {
31414 Self::DEFAULT.clone()
31415 }
31416}
31417impl MessageData for VIBRATION_DATA {
31418 type Message = MavMessage;
31419 const ID: u32 = 241u32;
31420 const NAME: &'static str = "VIBRATION";
31421 const EXTRA_CRC: u8 = 90u8;
31422 const ENCODED_LEN: usize = 32usize;
31423 fn deser(
31424 _version: MavlinkVersion,
31425 __input: &[u8],
31426 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31427 let avail_len = __input.len();
31428 let mut payload_buf = [0; Self::ENCODED_LEN];
31429 let mut buf = if avail_len < Self::ENCODED_LEN {
31430 payload_buf[0..avail_len].copy_from_slice(__input);
31431 Bytes::new(&payload_buf)
31432 } else {
31433 Bytes::new(__input)
31434 };
31435 let mut __struct = Self::default();
31436 __struct.time_usec = buf.get_u64_le();
31437 __struct.vibration_x = buf.get_f32_le();
31438 __struct.vibration_y = buf.get_f32_le();
31439 __struct.vibration_z = buf.get_f32_le();
31440 __struct.clipping_0 = buf.get_u32_le();
31441 __struct.clipping_1 = buf.get_u32_le();
31442 __struct.clipping_2 = buf.get_u32_le();
31443 Ok(__struct)
31444 }
31445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31446 let mut __tmp = BytesMut::new(bytes);
31447 #[allow(clippy::absurd_extreme_comparisons)]
31448 #[allow(unused_comparisons)]
31449 if __tmp.remaining() < Self::ENCODED_LEN {
31450 panic!(
31451 "buffer is too small (need {} bytes, but got {})",
31452 Self::ENCODED_LEN,
31453 __tmp.remaining(),
31454 )
31455 }
31456 __tmp.put_u64_le(self.time_usec);
31457 __tmp.put_f32_le(self.vibration_x);
31458 __tmp.put_f32_le(self.vibration_y);
31459 __tmp.put_f32_le(self.vibration_z);
31460 __tmp.put_u32_le(self.clipping_0);
31461 __tmp.put_u32_le(self.clipping_1);
31462 __tmp.put_u32_le(self.clipping_2);
31463 if matches!(version, MavlinkVersion::V2) {
31464 let len = __tmp.len();
31465 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31466 } else {
31467 __tmp.len()
31468 }
31469 }
31470}
31471#[doc = "Global position estimate from a Vicon motion system source."]
31472#[doc = ""]
31473#[doc = "ID: 104"]
31474#[derive(Debug, Clone, PartialEq)]
31475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31477#[cfg_attr(feature = "ts", derive(TS))]
31478#[cfg_attr(feature = "ts", ts(export))]
31479pub struct VICON_POSITION_ESTIMATE_DATA {
31480 #[doc = "Timestamp (UNIX time or time since system boot)"]
31481 pub usec: u64,
31482 #[doc = "Global X position"]
31483 pub x: f32,
31484 #[doc = "Global Y position"]
31485 pub y: f32,
31486 #[doc = "Global Z position"]
31487 pub z: f32,
31488 #[doc = "Roll angle"]
31489 pub roll: f32,
31490 #[doc = "Pitch angle"]
31491 pub pitch: f32,
31492 #[doc = "Yaw angle"]
31493 pub yaw: f32,
31494 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31495 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31496 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31497 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31498 pub covariance: [f32; 21],
31499}
31500impl VICON_POSITION_ESTIMATE_DATA {
31501 pub const ENCODED_LEN: usize = 116usize;
31502 pub const DEFAULT: Self = Self {
31503 usec: 0_u64,
31504 x: 0.0_f32,
31505 y: 0.0_f32,
31506 z: 0.0_f32,
31507 roll: 0.0_f32,
31508 pitch: 0.0_f32,
31509 yaw: 0.0_f32,
31510 covariance: [0.0_f32; 21usize],
31511 };
31512 #[cfg(feature = "arbitrary")]
31513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31514 use arbitrary::{Arbitrary, Unstructured};
31515 let mut buf = [0u8; 1024];
31516 rng.fill_bytes(&mut buf);
31517 let mut unstructured = Unstructured::new(&buf);
31518 Self::arbitrary(&mut unstructured).unwrap_or_default()
31519 }
31520}
31521impl Default for VICON_POSITION_ESTIMATE_DATA {
31522 fn default() -> Self {
31523 Self::DEFAULT.clone()
31524 }
31525}
31526impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31527 type Message = MavMessage;
31528 const ID: u32 = 104u32;
31529 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31530 const EXTRA_CRC: u8 = 56u8;
31531 const ENCODED_LEN: usize = 116usize;
31532 fn deser(
31533 _version: MavlinkVersion,
31534 __input: &[u8],
31535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31536 let avail_len = __input.len();
31537 let mut payload_buf = [0; Self::ENCODED_LEN];
31538 let mut buf = if avail_len < Self::ENCODED_LEN {
31539 payload_buf[0..avail_len].copy_from_slice(__input);
31540 Bytes::new(&payload_buf)
31541 } else {
31542 Bytes::new(__input)
31543 };
31544 let mut __struct = Self::default();
31545 __struct.usec = buf.get_u64_le();
31546 __struct.x = buf.get_f32_le();
31547 __struct.y = buf.get_f32_le();
31548 __struct.z = buf.get_f32_le();
31549 __struct.roll = buf.get_f32_le();
31550 __struct.pitch = buf.get_f32_le();
31551 __struct.yaw = buf.get_f32_le();
31552 for v in &mut __struct.covariance {
31553 let val = buf.get_f32_le();
31554 *v = val;
31555 }
31556 Ok(__struct)
31557 }
31558 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31559 let mut __tmp = BytesMut::new(bytes);
31560 #[allow(clippy::absurd_extreme_comparisons)]
31561 #[allow(unused_comparisons)]
31562 if __tmp.remaining() < Self::ENCODED_LEN {
31563 panic!(
31564 "buffer is too small (need {} bytes, but got {})",
31565 Self::ENCODED_LEN,
31566 __tmp.remaining(),
31567 )
31568 }
31569 __tmp.put_u64_le(self.usec);
31570 __tmp.put_f32_le(self.x);
31571 __tmp.put_f32_le(self.y);
31572 __tmp.put_f32_le(self.z);
31573 __tmp.put_f32_le(self.roll);
31574 __tmp.put_f32_le(self.pitch);
31575 __tmp.put_f32_le(self.yaw);
31576 if matches!(version, MavlinkVersion::V2) {
31577 for val in &self.covariance {
31578 __tmp.put_f32_le(*val);
31579 }
31580 let len = __tmp.len();
31581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31582 } else {
31583 __tmp.len()
31584 }
31585 }
31586}
31587#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31588#[doc = ""]
31589#[doc = "ID: 269"]
31590#[derive(Debug, Clone, PartialEq)]
31591#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31592#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31593#[cfg_attr(feature = "ts", derive(TS))]
31594#[cfg_attr(feature = "ts", ts(export))]
31595pub struct VIDEO_STREAM_INFORMATION_DATA {
31596 #[doc = "Frame rate."]
31597 pub framerate: f32,
31598 #[doc = "Bit rate."]
31599 pub bitrate: u32,
31600 #[doc = "Bitmap of stream status flags."]
31601 pub flags: VideoStreamStatusFlags,
31602 #[doc = "Horizontal resolution."]
31603 pub resolution_h: u16,
31604 #[doc = "Vertical resolution."]
31605 pub resolution_v: u16,
31606 #[doc = "Video image rotation clockwise."]
31607 pub rotation: u16,
31608 #[doc = "Horizontal Field of view."]
31609 pub hfov: u16,
31610 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31611 pub stream_id: u8,
31612 #[doc = "Number of streams available."]
31613 pub count: u8,
31614 #[doc = "Type of stream."]
31615 pub mavtype: VideoStreamType,
31616 #[doc = "Stream name."]
31617 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31618 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31619 pub name: [u8; 32],
31620 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31621 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31622 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31623 pub uri: [u8; 160],
31624 #[doc = "Encoding of stream."]
31625 #[cfg_attr(feature = "serde", serde(default))]
31626 pub encoding: VideoStreamEncoding,
31627 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31628 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31629 pub camera_device_id: u8,
31630}
31631impl VIDEO_STREAM_INFORMATION_DATA {
31632 pub const ENCODED_LEN: usize = 215usize;
31633 pub const DEFAULT: Self = Self {
31634 framerate: 0.0_f32,
31635 bitrate: 0_u32,
31636 flags: VideoStreamStatusFlags::DEFAULT,
31637 resolution_h: 0_u16,
31638 resolution_v: 0_u16,
31639 rotation: 0_u16,
31640 hfov: 0_u16,
31641 stream_id: 0_u8,
31642 count: 0_u8,
31643 mavtype: VideoStreamType::DEFAULT,
31644 name: [0_u8; 32usize],
31645 uri: [0_u8; 160usize],
31646 encoding: VideoStreamEncoding::DEFAULT,
31647 camera_device_id: 0_u8,
31648 };
31649 #[cfg(feature = "arbitrary")]
31650 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31651 use arbitrary::{Arbitrary, Unstructured};
31652 let mut buf = [0u8; 1024];
31653 rng.fill_bytes(&mut buf);
31654 let mut unstructured = Unstructured::new(&buf);
31655 Self::arbitrary(&mut unstructured).unwrap_or_default()
31656 }
31657}
31658impl Default for VIDEO_STREAM_INFORMATION_DATA {
31659 fn default() -> Self {
31660 Self::DEFAULT.clone()
31661 }
31662}
31663impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31664 type Message = MavMessage;
31665 const ID: u32 = 269u32;
31666 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31667 const EXTRA_CRC: u8 = 109u8;
31668 const ENCODED_LEN: usize = 215usize;
31669 fn deser(
31670 _version: MavlinkVersion,
31671 __input: &[u8],
31672 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31673 let avail_len = __input.len();
31674 let mut payload_buf = [0; Self::ENCODED_LEN];
31675 let mut buf = if avail_len < Self::ENCODED_LEN {
31676 payload_buf[0..avail_len].copy_from_slice(__input);
31677 Bytes::new(&payload_buf)
31678 } else {
31679 Bytes::new(__input)
31680 };
31681 let mut __struct = Self::default();
31682 __struct.framerate = buf.get_f32_le();
31683 __struct.bitrate = buf.get_u32_le();
31684 let tmp = buf.get_u16_le();
31685 __struct.flags = VideoStreamStatusFlags::from_bits(
31686 tmp & VideoStreamStatusFlags::all().bits(),
31687 )
31688 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31689 flag_type: "VideoStreamStatusFlags",
31690 value: tmp as u32,
31691 })?;
31692 __struct.resolution_h = buf.get_u16_le();
31693 __struct.resolution_v = buf.get_u16_le();
31694 __struct.rotation = buf.get_u16_le();
31695 __struct.hfov = buf.get_u16_le();
31696 __struct.stream_id = buf.get_u8();
31697 __struct.count = buf.get_u8();
31698 let tmp = buf.get_u8();
31699 __struct.mavtype =
31700 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31701 enum_type: "VideoStreamType",
31702 value: tmp as u32,
31703 })?;
31704 for v in &mut __struct.name {
31705 let val = buf.get_u8();
31706 *v = val;
31707 }
31708 for v in &mut __struct.uri {
31709 let val = buf.get_u8();
31710 *v = val;
31711 }
31712 let tmp = buf.get_u8();
31713 __struct.encoding =
31714 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31715 enum_type: "VideoStreamEncoding",
31716 value: tmp as u32,
31717 })?;
31718 __struct.camera_device_id = buf.get_u8();
31719 Ok(__struct)
31720 }
31721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31722 let mut __tmp = BytesMut::new(bytes);
31723 #[allow(clippy::absurd_extreme_comparisons)]
31724 #[allow(unused_comparisons)]
31725 if __tmp.remaining() < Self::ENCODED_LEN {
31726 panic!(
31727 "buffer is too small (need {} bytes, but got {})",
31728 Self::ENCODED_LEN,
31729 __tmp.remaining(),
31730 )
31731 }
31732 __tmp.put_f32_le(self.framerate);
31733 __tmp.put_u32_le(self.bitrate);
31734 __tmp.put_u16_le(self.flags.bits());
31735 __tmp.put_u16_le(self.resolution_h);
31736 __tmp.put_u16_le(self.resolution_v);
31737 __tmp.put_u16_le(self.rotation);
31738 __tmp.put_u16_le(self.hfov);
31739 __tmp.put_u8(self.stream_id);
31740 __tmp.put_u8(self.count);
31741 __tmp.put_u8(self.mavtype as u8);
31742 for val in &self.name {
31743 __tmp.put_u8(*val);
31744 }
31745 for val in &self.uri {
31746 __tmp.put_u8(*val);
31747 }
31748 if matches!(version, MavlinkVersion::V2) {
31749 __tmp.put_u8(self.encoding as u8);
31750 __tmp.put_u8(self.camera_device_id);
31751 let len = __tmp.len();
31752 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31753 } else {
31754 __tmp.len()
31755 }
31756 }
31757}
31758#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
31759#[doc = ""]
31760#[doc = "ID: 270"]
31761#[derive(Debug, Clone, PartialEq)]
31762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31764#[cfg_attr(feature = "ts", derive(TS))]
31765#[cfg_attr(feature = "ts", ts(export))]
31766pub struct VIDEO_STREAM_STATUS_DATA {
31767 #[doc = "Frame rate"]
31768 pub framerate: f32,
31769 #[doc = "Bit rate"]
31770 pub bitrate: u32,
31771 #[doc = "Bitmap of stream status flags"]
31772 pub flags: VideoStreamStatusFlags,
31773 #[doc = "Horizontal resolution"]
31774 pub resolution_h: u16,
31775 #[doc = "Vertical resolution"]
31776 pub resolution_v: u16,
31777 #[doc = "Video image rotation clockwise"]
31778 pub rotation: u16,
31779 #[doc = "Horizontal Field of view"]
31780 pub hfov: u16,
31781 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31782 pub stream_id: u8,
31783 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31784 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31785 pub camera_device_id: u8,
31786}
31787impl VIDEO_STREAM_STATUS_DATA {
31788 pub const ENCODED_LEN: usize = 20usize;
31789 pub const DEFAULT: Self = Self {
31790 framerate: 0.0_f32,
31791 bitrate: 0_u32,
31792 flags: VideoStreamStatusFlags::DEFAULT,
31793 resolution_h: 0_u16,
31794 resolution_v: 0_u16,
31795 rotation: 0_u16,
31796 hfov: 0_u16,
31797 stream_id: 0_u8,
31798 camera_device_id: 0_u8,
31799 };
31800 #[cfg(feature = "arbitrary")]
31801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31802 use arbitrary::{Arbitrary, Unstructured};
31803 let mut buf = [0u8; 1024];
31804 rng.fill_bytes(&mut buf);
31805 let mut unstructured = Unstructured::new(&buf);
31806 Self::arbitrary(&mut unstructured).unwrap_or_default()
31807 }
31808}
31809impl Default for VIDEO_STREAM_STATUS_DATA {
31810 fn default() -> Self {
31811 Self::DEFAULT.clone()
31812 }
31813}
31814impl MessageData for VIDEO_STREAM_STATUS_DATA {
31815 type Message = MavMessage;
31816 const ID: u32 = 270u32;
31817 const NAME: &'static str = "VIDEO_STREAM_STATUS";
31818 const EXTRA_CRC: u8 = 59u8;
31819 const ENCODED_LEN: usize = 20usize;
31820 fn deser(
31821 _version: MavlinkVersion,
31822 __input: &[u8],
31823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31824 let avail_len = __input.len();
31825 let mut payload_buf = [0; Self::ENCODED_LEN];
31826 let mut buf = if avail_len < Self::ENCODED_LEN {
31827 payload_buf[0..avail_len].copy_from_slice(__input);
31828 Bytes::new(&payload_buf)
31829 } else {
31830 Bytes::new(__input)
31831 };
31832 let mut __struct = Self::default();
31833 __struct.framerate = buf.get_f32_le();
31834 __struct.bitrate = buf.get_u32_le();
31835 let tmp = buf.get_u16_le();
31836 __struct.flags = VideoStreamStatusFlags::from_bits(
31837 tmp & VideoStreamStatusFlags::all().bits(),
31838 )
31839 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31840 flag_type: "VideoStreamStatusFlags",
31841 value: tmp as u32,
31842 })?;
31843 __struct.resolution_h = buf.get_u16_le();
31844 __struct.resolution_v = buf.get_u16_le();
31845 __struct.rotation = buf.get_u16_le();
31846 __struct.hfov = buf.get_u16_le();
31847 __struct.stream_id = buf.get_u8();
31848 __struct.camera_device_id = buf.get_u8();
31849 Ok(__struct)
31850 }
31851 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31852 let mut __tmp = BytesMut::new(bytes);
31853 #[allow(clippy::absurd_extreme_comparisons)]
31854 #[allow(unused_comparisons)]
31855 if __tmp.remaining() < Self::ENCODED_LEN {
31856 panic!(
31857 "buffer is too small (need {} bytes, but got {})",
31858 Self::ENCODED_LEN,
31859 __tmp.remaining(),
31860 )
31861 }
31862 __tmp.put_f32_le(self.framerate);
31863 __tmp.put_u32_le(self.bitrate);
31864 __tmp.put_u16_le(self.flags.bits());
31865 __tmp.put_u16_le(self.resolution_h);
31866 __tmp.put_u16_le(self.resolution_v);
31867 __tmp.put_u16_le(self.rotation);
31868 __tmp.put_u16_le(self.hfov);
31869 __tmp.put_u8(self.stream_id);
31870 if matches!(version, MavlinkVersion::V2) {
31871 __tmp.put_u8(self.camera_device_id);
31872 let len = __tmp.len();
31873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31874 } else {
31875 __tmp.len()
31876 }
31877 }
31878}
31879#[doc = "Local position/attitude estimate from a vision source."]
31880#[doc = ""]
31881#[doc = "ID: 102"]
31882#[derive(Debug, Clone, PartialEq)]
31883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31885#[cfg_attr(feature = "ts", derive(TS))]
31886#[cfg_attr(feature = "ts", ts(export))]
31887pub struct VISION_POSITION_ESTIMATE_DATA {
31888 #[doc = "Timestamp (UNIX time or time since system boot)"]
31889 pub usec: u64,
31890 #[doc = "Local X position"]
31891 pub x: f32,
31892 #[doc = "Local Y position"]
31893 pub y: f32,
31894 #[doc = "Local Z position"]
31895 pub z: f32,
31896 #[doc = "Roll angle"]
31897 pub roll: f32,
31898 #[doc = "Pitch angle"]
31899 pub pitch: f32,
31900 #[doc = "Yaw angle"]
31901 pub yaw: f32,
31902 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31903 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31904 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31905 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31906 pub covariance: [f32; 21],
31907 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31908 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31909 pub reset_counter: u8,
31910}
31911impl VISION_POSITION_ESTIMATE_DATA {
31912 pub const ENCODED_LEN: usize = 117usize;
31913 pub const DEFAULT: Self = Self {
31914 usec: 0_u64,
31915 x: 0.0_f32,
31916 y: 0.0_f32,
31917 z: 0.0_f32,
31918 roll: 0.0_f32,
31919 pitch: 0.0_f32,
31920 yaw: 0.0_f32,
31921 covariance: [0.0_f32; 21usize],
31922 reset_counter: 0_u8,
31923 };
31924 #[cfg(feature = "arbitrary")]
31925 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31926 use arbitrary::{Arbitrary, Unstructured};
31927 let mut buf = [0u8; 1024];
31928 rng.fill_bytes(&mut buf);
31929 let mut unstructured = Unstructured::new(&buf);
31930 Self::arbitrary(&mut unstructured).unwrap_or_default()
31931 }
31932}
31933impl Default for VISION_POSITION_ESTIMATE_DATA {
31934 fn default() -> Self {
31935 Self::DEFAULT.clone()
31936 }
31937}
31938impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31939 type Message = MavMessage;
31940 const ID: u32 = 102u32;
31941 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31942 const EXTRA_CRC: u8 = 158u8;
31943 const ENCODED_LEN: usize = 117usize;
31944 fn deser(
31945 _version: MavlinkVersion,
31946 __input: &[u8],
31947 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31948 let avail_len = __input.len();
31949 let mut payload_buf = [0; Self::ENCODED_LEN];
31950 let mut buf = if avail_len < Self::ENCODED_LEN {
31951 payload_buf[0..avail_len].copy_from_slice(__input);
31952 Bytes::new(&payload_buf)
31953 } else {
31954 Bytes::new(__input)
31955 };
31956 let mut __struct = Self::default();
31957 __struct.usec = buf.get_u64_le();
31958 __struct.x = buf.get_f32_le();
31959 __struct.y = buf.get_f32_le();
31960 __struct.z = buf.get_f32_le();
31961 __struct.roll = buf.get_f32_le();
31962 __struct.pitch = buf.get_f32_le();
31963 __struct.yaw = buf.get_f32_le();
31964 for v in &mut __struct.covariance {
31965 let val = buf.get_f32_le();
31966 *v = val;
31967 }
31968 __struct.reset_counter = buf.get_u8();
31969 Ok(__struct)
31970 }
31971 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31972 let mut __tmp = BytesMut::new(bytes);
31973 #[allow(clippy::absurd_extreme_comparisons)]
31974 #[allow(unused_comparisons)]
31975 if __tmp.remaining() < Self::ENCODED_LEN {
31976 panic!(
31977 "buffer is too small (need {} bytes, but got {})",
31978 Self::ENCODED_LEN,
31979 __tmp.remaining(),
31980 )
31981 }
31982 __tmp.put_u64_le(self.usec);
31983 __tmp.put_f32_le(self.x);
31984 __tmp.put_f32_le(self.y);
31985 __tmp.put_f32_le(self.z);
31986 __tmp.put_f32_le(self.roll);
31987 __tmp.put_f32_le(self.pitch);
31988 __tmp.put_f32_le(self.yaw);
31989 if matches!(version, MavlinkVersion::V2) {
31990 for val in &self.covariance {
31991 __tmp.put_f32_le(*val);
31992 }
31993 __tmp.put_u8(self.reset_counter);
31994 let len = __tmp.len();
31995 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31996 } else {
31997 __tmp.len()
31998 }
31999 }
32000}
32001#[doc = "Speed estimate from a vision source."]
32002#[doc = ""]
32003#[doc = "ID: 103"]
32004#[derive(Debug, Clone, PartialEq)]
32005#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32006#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32007#[cfg_attr(feature = "ts", derive(TS))]
32008#[cfg_attr(feature = "ts", ts(export))]
32009pub struct VISION_SPEED_ESTIMATE_DATA {
32010 #[doc = "Timestamp (UNIX time or time since system boot)"]
32011 pub usec: u64,
32012 #[doc = "Global X speed"]
32013 pub x: f32,
32014 #[doc = "Global Y speed"]
32015 pub y: f32,
32016 #[doc = "Global Z speed"]
32017 pub z: f32,
32018 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
32019 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32020 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32021 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32022 pub covariance: [f32; 9],
32023 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32024 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32025 pub reset_counter: u8,
32026}
32027impl VISION_SPEED_ESTIMATE_DATA {
32028 pub const ENCODED_LEN: usize = 57usize;
32029 pub const DEFAULT: Self = Self {
32030 usec: 0_u64,
32031 x: 0.0_f32,
32032 y: 0.0_f32,
32033 z: 0.0_f32,
32034 covariance: [0.0_f32; 9usize],
32035 reset_counter: 0_u8,
32036 };
32037 #[cfg(feature = "arbitrary")]
32038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32039 use arbitrary::{Arbitrary, Unstructured};
32040 let mut buf = [0u8; 1024];
32041 rng.fill_bytes(&mut buf);
32042 let mut unstructured = Unstructured::new(&buf);
32043 Self::arbitrary(&mut unstructured).unwrap_or_default()
32044 }
32045}
32046impl Default for VISION_SPEED_ESTIMATE_DATA {
32047 fn default() -> Self {
32048 Self::DEFAULT.clone()
32049 }
32050}
32051impl MessageData for VISION_SPEED_ESTIMATE_DATA {
32052 type Message = MavMessage;
32053 const ID: u32 = 103u32;
32054 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
32055 const EXTRA_CRC: u8 = 208u8;
32056 const ENCODED_LEN: usize = 57usize;
32057 fn deser(
32058 _version: MavlinkVersion,
32059 __input: &[u8],
32060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32061 let avail_len = __input.len();
32062 let mut payload_buf = [0; Self::ENCODED_LEN];
32063 let mut buf = if avail_len < Self::ENCODED_LEN {
32064 payload_buf[0..avail_len].copy_from_slice(__input);
32065 Bytes::new(&payload_buf)
32066 } else {
32067 Bytes::new(__input)
32068 };
32069 let mut __struct = Self::default();
32070 __struct.usec = buf.get_u64_le();
32071 __struct.x = buf.get_f32_le();
32072 __struct.y = buf.get_f32_le();
32073 __struct.z = buf.get_f32_le();
32074 for v in &mut __struct.covariance {
32075 let val = buf.get_f32_le();
32076 *v = val;
32077 }
32078 __struct.reset_counter = buf.get_u8();
32079 Ok(__struct)
32080 }
32081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32082 let mut __tmp = BytesMut::new(bytes);
32083 #[allow(clippy::absurd_extreme_comparisons)]
32084 #[allow(unused_comparisons)]
32085 if __tmp.remaining() < Self::ENCODED_LEN {
32086 panic!(
32087 "buffer is too small (need {} bytes, but got {})",
32088 Self::ENCODED_LEN,
32089 __tmp.remaining(),
32090 )
32091 }
32092 __tmp.put_u64_le(self.usec);
32093 __tmp.put_f32_le(self.x);
32094 __tmp.put_f32_le(self.y);
32095 __tmp.put_f32_le(self.z);
32096 if matches!(version, MavlinkVersion::V2) {
32097 for val in &self.covariance {
32098 __tmp.put_f32_le(*val);
32099 }
32100 __tmp.put_u8(self.reset_counter);
32101 let len = __tmp.len();
32102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32103 } else {
32104 __tmp.len()
32105 }
32106 }
32107}
32108#[doc = "Cumulative distance traveled for each reported wheel."]
32109#[doc = ""]
32110#[doc = "ID: 9000"]
32111#[derive(Debug, Clone, PartialEq)]
32112#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32114#[cfg_attr(feature = "ts", derive(TS))]
32115#[cfg_attr(feature = "ts", ts(export))]
32116pub struct WHEEL_DISTANCE_DATA {
32117 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32118 pub time_usec: u64,
32119 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32120 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32121 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32122 pub distance: [f64; 16],
32123 #[doc = "Number of wheels reported."]
32124 pub count: u8,
32125}
32126impl WHEEL_DISTANCE_DATA {
32127 pub const ENCODED_LEN: usize = 137usize;
32128 pub const DEFAULT: Self = Self {
32129 time_usec: 0_u64,
32130 distance: [0.0_f64; 16usize],
32131 count: 0_u8,
32132 };
32133 #[cfg(feature = "arbitrary")]
32134 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32135 use arbitrary::{Arbitrary, Unstructured};
32136 let mut buf = [0u8; 1024];
32137 rng.fill_bytes(&mut buf);
32138 let mut unstructured = Unstructured::new(&buf);
32139 Self::arbitrary(&mut unstructured).unwrap_or_default()
32140 }
32141}
32142impl Default for WHEEL_DISTANCE_DATA {
32143 fn default() -> Self {
32144 Self::DEFAULT.clone()
32145 }
32146}
32147impl MessageData for WHEEL_DISTANCE_DATA {
32148 type Message = MavMessage;
32149 const ID: u32 = 9000u32;
32150 const NAME: &'static str = "WHEEL_DISTANCE";
32151 const EXTRA_CRC: u8 = 113u8;
32152 const ENCODED_LEN: usize = 137usize;
32153 fn deser(
32154 _version: MavlinkVersion,
32155 __input: &[u8],
32156 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32157 let avail_len = __input.len();
32158 let mut payload_buf = [0; Self::ENCODED_LEN];
32159 let mut buf = if avail_len < Self::ENCODED_LEN {
32160 payload_buf[0..avail_len].copy_from_slice(__input);
32161 Bytes::new(&payload_buf)
32162 } else {
32163 Bytes::new(__input)
32164 };
32165 let mut __struct = Self::default();
32166 __struct.time_usec = buf.get_u64_le();
32167 for v in &mut __struct.distance {
32168 let val = buf.get_f64_le();
32169 *v = val;
32170 }
32171 __struct.count = buf.get_u8();
32172 Ok(__struct)
32173 }
32174 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32175 let mut __tmp = BytesMut::new(bytes);
32176 #[allow(clippy::absurd_extreme_comparisons)]
32177 #[allow(unused_comparisons)]
32178 if __tmp.remaining() < Self::ENCODED_LEN {
32179 panic!(
32180 "buffer is too small (need {} bytes, but got {})",
32181 Self::ENCODED_LEN,
32182 __tmp.remaining(),
32183 )
32184 }
32185 __tmp.put_u64_le(self.time_usec);
32186 for val in &self.distance {
32187 __tmp.put_f64_le(*val);
32188 }
32189 __tmp.put_u8(self.count);
32190 if matches!(version, MavlinkVersion::V2) {
32191 let len = __tmp.len();
32192 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32193 } else {
32194 __tmp.len()
32195 }
32196 }
32197}
32198#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32199#[doc = ""]
32200#[doc = "ID: 299"]
32201#[derive(Debug, Clone, PartialEq)]
32202#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32204#[cfg_attr(feature = "ts", derive(TS))]
32205#[cfg_attr(feature = "ts", ts(export))]
32206pub struct WIFI_CONFIG_AP_DATA {
32207 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32208 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32209 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32210 pub ssid: [u8; 32],
32211 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32212 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32213 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32214 pub password: [u8; 64],
32215 #[doc = "WiFi Mode."]
32216 #[cfg_attr(feature = "serde", serde(default))]
32217 pub mode: WifiConfigApMode,
32218 #[doc = "Message acceptance response (sent back to GS)."]
32219 #[cfg_attr(feature = "serde", serde(default))]
32220 pub response: WifiConfigApResponse,
32221}
32222impl WIFI_CONFIG_AP_DATA {
32223 pub const ENCODED_LEN: usize = 98usize;
32224 pub const DEFAULT: Self = Self {
32225 ssid: [0_u8; 32usize],
32226 password: [0_u8; 64usize],
32227 mode: WifiConfigApMode::DEFAULT,
32228 response: WifiConfigApResponse::DEFAULT,
32229 };
32230 #[cfg(feature = "arbitrary")]
32231 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32232 use arbitrary::{Arbitrary, Unstructured};
32233 let mut buf = [0u8; 1024];
32234 rng.fill_bytes(&mut buf);
32235 let mut unstructured = Unstructured::new(&buf);
32236 Self::arbitrary(&mut unstructured).unwrap_or_default()
32237 }
32238}
32239impl Default for WIFI_CONFIG_AP_DATA {
32240 fn default() -> Self {
32241 Self::DEFAULT.clone()
32242 }
32243}
32244impl MessageData for WIFI_CONFIG_AP_DATA {
32245 type Message = MavMessage;
32246 const ID: u32 = 299u32;
32247 const NAME: &'static str = "WIFI_CONFIG_AP";
32248 const EXTRA_CRC: u8 = 19u8;
32249 const ENCODED_LEN: usize = 98usize;
32250 fn deser(
32251 _version: MavlinkVersion,
32252 __input: &[u8],
32253 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32254 let avail_len = __input.len();
32255 let mut payload_buf = [0; Self::ENCODED_LEN];
32256 let mut buf = if avail_len < Self::ENCODED_LEN {
32257 payload_buf[0..avail_len].copy_from_slice(__input);
32258 Bytes::new(&payload_buf)
32259 } else {
32260 Bytes::new(__input)
32261 };
32262 let mut __struct = Self::default();
32263 for v in &mut __struct.ssid {
32264 let val = buf.get_u8();
32265 *v = val;
32266 }
32267 for v in &mut __struct.password {
32268 let val = buf.get_u8();
32269 *v = val;
32270 }
32271 let tmp = buf.get_i8();
32272 __struct.mode =
32273 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32274 enum_type: "WifiConfigApMode",
32275 value: tmp as u32,
32276 })?;
32277 let tmp = buf.get_i8();
32278 __struct.response =
32279 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32280 enum_type: "WifiConfigApResponse",
32281 value: tmp as u32,
32282 })?;
32283 Ok(__struct)
32284 }
32285 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32286 let mut __tmp = BytesMut::new(bytes);
32287 #[allow(clippy::absurd_extreme_comparisons)]
32288 #[allow(unused_comparisons)]
32289 if __tmp.remaining() < Self::ENCODED_LEN {
32290 panic!(
32291 "buffer is too small (need {} bytes, but got {})",
32292 Self::ENCODED_LEN,
32293 __tmp.remaining(),
32294 )
32295 }
32296 for val in &self.ssid {
32297 __tmp.put_u8(*val);
32298 }
32299 for val in &self.password {
32300 __tmp.put_u8(*val);
32301 }
32302 if matches!(version, MavlinkVersion::V2) {
32303 __tmp.put_i8(self.mode as i8);
32304 __tmp.put_i8(self.response as i8);
32305 let len = __tmp.len();
32306 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32307 } else {
32308 __tmp.len()
32309 }
32310 }
32311}
32312#[doc = "Winch status."]
32313#[doc = ""]
32314#[doc = "ID: 9005"]
32315#[derive(Debug, Clone, PartialEq)]
32316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32318#[cfg_attr(feature = "ts", derive(TS))]
32319#[cfg_attr(feature = "ts", ts(export))]
32320pub struct WINCH_STATUS_DATA {
32321 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32322 pub time_usec: u64,
32323 #[doc = "Length of line released. NaN if unknown"]
32324 pub line_length: f32,
32325 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32326 pub speed: f32,
32327 #[doc = "Tension on the line. NaN if unknown"]
32328 pub tension: f32,
32329 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32330 pub voltage: f32,
32331 #[doc = "Current draw from the winch. NaN if unknown"]
32332 pub current: f32,
32333 #[doc = "Status flags"]
32334 pub status: MavWinchStatusFlag,
32335 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32336 pub temperature: i16,
32337}
32338impl WINCH_STATUS_DATA {
32339 pub const ENCODED_LEN: usize = 34usize;
32340 pub const DEFAULT: Self = Self {
32341 time_usec: 0_u64,
32342 line_length: 0.0_f32,
32343 speed: 0.0_f32,
32344 tension: 0.0_f32,
32345 voltage: 0.0_f32,
32346 current: 0.0_f32,
32347 status: MavWinchStatusFlag::DEFAULT,
32348 temperature: 0_i16,
32349 };
32350 #[cfg(feature = "arbitrary")]
32351 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32352 use arbitrary::{Arbitrary, Unstructured};
32353 let mut buf = [0u8; 1024];
32354 rng.fill_bytes(&mut buf);
32355 let mut unstructured = Unstructured::new(&buf);
32356 Self::arbitrary(&mut unstructured).unwrap_or_default()
32357 }
32358}
32359impl Default for WINCH_STATUS_DATA {
32360 fn default() -> Self {
32361 Self::DEFAULT.clone()
32362 }
32363}
32364impl MessageData for WINCH_STATUS_DATA {
32365 type Message = MavMessage;
32366 const ID: u32 = 9005u32;
32367 const NAME: &'static str = "WINCH_STATUS";
32368 const EXTRA_CRC: u8 = 117u8;
32369 const ENCODED_LEN: usize = 34usize;
32370 fn deser(
32371 _version: MavlinkVersion,
32372 __input: &[u8],
32373 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32374 let avail_len = __input.len();
32375 let mut payload_buf = [0; Self::ENCODED_LEN];
32376 let mut buf = if avail_len < Self::ENCODED_LEN {
32377 payload_buf[0..avail_len].copy_from_slice(__input);
32378 Bytes::new(&payload_buf)
32379 } else {
32380 Bytes::new(__input)
32381 };
32382 let mut __struct = Self::default();
32383 __struct.time_usec = buf.get_u64_le();
32384 __struct.line_length = buf.get_f32_le();
32385 __struct.speed = buf.get_f32_le();
32386 __struct.tension = buf.get_f32_le();
32387 __struct.voltage = buf.get_f32_le();
32388 __struct.current = buf.get_f32_le();
32389 let tmp = buf.get_u32_le();
32390 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
32391 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32392 flag_type: "MavWinchStatusFlag",
32393 value: tmp as u32,
32394 })?;
32395 __struct.temperature = buf.get_i16_le();
32396 Ok(__struct)
32397 }
32398 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32399 let mut __tmp = BytesMut::new(bytes);
32400 #[allow(clippy::absurd_extreme_comparisons)]
32401 #[allow(unused_comparisons)]
32402 if __tmp.remaining() < Self::ENCODED_LEN {
32403 panic!(
32404 "buffer is too small (need {} bytes, but got {})",
32405 Self::ENCODED_LEN,
32406 __tmp.remaining(),
32407 )
32408 }
32409 __tmp.put_u64_le(self.time_usec);
32410 __tmp.put_f32_le(self.line_length);
32411 __tmp.put_f32_le(self.speed);
32412 __tmp.put_f32_le(self.tension);
32413 __tmp.put_f32_le(self.voltage);
32414 __tmp.put_f32_le(self.current);
32415 __tmp.put_u32_le(self.status.bits());
32416 __tmp.put_i16_le(self.temperature);
32417 if matches!(version, MavlinkVersion::V2) {
32418 let len = __tmp.len();
32419 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32420 } else {
32421 __tmp.len()
32422 }
32423 }
32424}
32425#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32426#[doc = ""]
32427#[doc = "ID: 231"]
32428#[derive(Debug, Clone, PartialEq)]
32429#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32430#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32431#[cfg_attr(feature = "ts", derive(TS))]
32432#[cfg_attr(feature = "ts", ts(export))]
32433pub struct WIND_COV_DATA {
32434 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32435 pub time_usec: u64,
32436 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32437 pub wind_x: f32,
32438 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32439 pub wind_y: f32,
32440 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32441 pub wind_z: f32,
32442 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32443 pub var_horiz: f32,
32444 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32445 pub var_vert: f32,
32446 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32447 pub wind_alt: f32,
32448 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32449 pub horiz_accuracy: f32,
32450 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32451 pub vert_accuracy: f32,
32452}
32453impl WIND_COV_DATA {
32454 pub const ENCODED_LEN: usize = 40usize;
32455 pub const DEFAULT: Self = Self {
32456 time_usec: 0_u64,
32457 wind_x: 0.0_f32,
32458 wind_y: 0.0_f32,
32459 wind_z: 0.0_f32,
32460 var_horiz: 0.0_f32,
32461 var_vert: 0.0_f32,
32462 wind_alt: 0.0_f32,
32463 horiz_accuracy: 0.0_f32,
32464 vert_accuracy: 0.0_f32,
32465 };
32466 #[cfg(feature = "arbitrary")]
32467 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32468 use arbitrary::{Arbitrary, Unstructured};
32469 let mut buf = [0u8; 1024];
32470 rng.fill_bytes(&mut buf);
32471 let mut unstructured = Unstructured::new(&buf);
32472 Self::arbitrary(&mut unstructured).unwrap_or_default()
32473 }
32474}
32475impl Default for WIND_COV_DATA {
32476 fn default() -> Self {
32477 Self::DEFAULT.clone()
32478 }
32479}
32480impl MessageData for WIND_COV_DATA {
32481 type Message = MavMessage;
32482 const ID: u32 = 231u32;
32483 const NAME: &'static str = "WIND_COV";
32484 const EXTRA_CRC: u8 = 105u8;
32485 const ENCODED_LEN: usize = 40usize;
32486 fn deser(
32487 _version: MavlinkVersion,
32488 __input: &[u8],
32489 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32490 let avail_len = __input.len();
32491 let mut payload_buf = [0; Self::ENCODED_LEN];
32492 let mut buf = if avail_len < Self::ENCODED_LEN {
32493 payload_buf[0..avail_len].copy_from_slice(__input);
32494 Bytes::new(&payload_buf)
32495 } else {
32496 Bytes::new(__input)
32497 };
32498 let mut __struct = Self::default();
32499 __struct.time_usec = buf.get_u64_le();
32500 __struct.wind_x = buf.get_f32_le();
32501 __struct.wind_y = buf.get_f32_le();
32502 __struct.wind_z = buf.get_f32_le();
32503 __struct.var_horiz = buf.get_f32_le();
32504 __struct.var_vert = buf.get_f32_le();
32505 __struct.wind_alt = buf.get_f32_le();
32506 __struct.horiz_accuracy = buf.get_f32_le();
32507 __struct.vert_accuracy = buf.get_f32_le();
32508 Ok(__struct)
32509 }
32510 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32511 let mut __tmp = BytesMut::new(bytes);
32512 #[allow(clippy::absurd_extreme_comparisons)]
32513 #[allow(unused_comparisons)]
32514 if __tmp.remaining() < Self::ENCODED_LEN {
32515 panic!(
32516 "buffer is too small (need {} bytes, but got {})",
32517 Self::ENCODED_LEN,
32518 __tmp.remaining(),
32519 )
32520 }
32521 __tmp.put_u64_le(self.time_usec);
32522 __tmp.put_f32_le(self.wind_x);
32523 __tmp.put_f32_le(self.wind_y);
32524 __tmp.put_f32_le(self.wind_z);
32525 __tmp.put_f32_le(self.var_horiz);
32526 __tmp.put_f32_le(self.var_vert);
32527 __tmp.put_f32_le(self.wind_alt);
32528 __tmp.put_f32_le(self.horiz_accuracy);
32529 __tmp.put_f32_le(self.vert_accuracy);
32530 if matches!(version, MavlinkVersion::V2) {
32531 let len = __tmp.len();
32532 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32533 } else {
32534 __tmp.len()
32535 }
32536 }
32537}
32538#[derive(Clone, PartialEq, Debug)]
32539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32540#[cfg_attr(feature = "serde", serde(tag = "type"))]
32541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32542#[cfg_attr(feature = "ts", derive(TS))]
32543#[cfg_attr(feature = "ts", ts(export))]
32544#[repr(u32)]
32545pub enum MavMessage {
32546 #[doc = "Set the vehicle attitude and body angular rates."]
32547 #[doc = ""]
32548 #[doc = "ID: 140"]
32549 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32550 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
32551 #[doc = ""]
32552 #[doc = "ID: 375"]
32553 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32554 #[doc = "The location and information of an ADSB vehicle."]
32555 #[doc = ""]
32556 #[doc = "ID: 246"]
32557 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32558 #[doc = "The location and information of an AIS vessel."]
32559 #[doc = ""]
32560 #[doc = "ID: 301"]
32561 AIS_VESSEL(AIS_VESSEL_DATA),
32562 #[doc = "The current system altitude."]
32563 #[doc = ""]
32564 #[doc = "ID: 141"]
32565 ALTITUDE(ALTITUDE_DATA),
32566 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
32567 #[doc = ""]
32568 #[doc = "ID: 30"]
32569 ATTITUDE(ATTITUDE_DATA),
32570 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32571 #[doc = ""]
32572 #[doc = "ID: 31"]
32573 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32574 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32575 #[doc = ""]
32576 #[doc = "ID: 61"]
32577 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32578 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
32579 #[doc = ""]
32580 #[doc = "ID: 83"]
32581 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32582 #[doc = "Motion capture attitude and position."]
32583 #[doc = ""]
32584 #[doc = "ID: 138"]
32585 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32586 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
32587 #[doc = ""]
32588 #[doc = "ID: 7"]
32589 AUTH_KEY(AUTH_KEY_DATA),
32590 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
32591 #[doc = ""]
32592 #[doc = "ID: 286"]
32593 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32594 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
32595 #[doc = ""]
32596 #[doc = "ID: 148"]
32597 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32598 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
32599 #[doc = ""]
32600 #[doc = "ID: 435"]
32601 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32602 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
32603 #[doc = ""]
32604 #[doc = "ID: 437"]
32605 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32606 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
32607 #[doc = ""]
32608 #[doc = "ID: 372"]
32609 BATTERY_INFO(BATTERY_INFO_DATA),
32610 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
32611 #[doc = ""]
32612 #[doc = "ID: 147"]
32613 BATTERY_STATUS(BATTERY_STATUS_DATA),
32614 #[doc = "Report button state change."]
32615 #[doc = ""]
32616 #[doc = "ID: 257"]
32617 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32618 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32619 #[doc = ""]
32620 #[doc = "ID: 262"]
32621 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32622 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32623 #[doc = ""]
32624 #[doc = "ID: 271"]
32625 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32626 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
32627 #[doc = ""]
32628 #[doc = "ID: 263"]
32629 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32630 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32631 #[doc = ""]
32632 #[doc = "ID: 259"]
32633 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32634 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32635 #[doc = ""]
32636 #[doc = "ID: 260"]
32637 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32638 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
32639 #[doc = ""]
32640 #[doc = "ID: 277"]
32641 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32642 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32643 #[doc = ""]
32644 #[doc = "ID: 276"]
32645 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32646 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32647 #[doc = ""]
32648 #[doc = "ID: 275"]
32649 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32650 #[doc = "Camera-IMU triggering and synchronisation message."]
32651 #[doc = ""]
32652 #[doc = "ID: 112"]
32653 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32654 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
32655 #[doc = ""]
32656 #[doc = "ID: 387"]
32657 CANFD_FRAME(CANFD_FRAME_DATA),
32658 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
32659 #[doc = ""]
32660 #[doc = "ID: 388"]
32661 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32662 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
32663 #[doc = ""]
32664 #[doc = "ID: 386"]
32665 CAN_FRAME(CAN_FRAME_DATA),
32666 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32667 #[doc = ""]
32668 #[doc = "ID: 336"]
32669 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32670 #[doc = "Report current used cellular network status."]
32671 #[doc = ""]
32672 #[doc = "ID: 334"]
32673 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32674 #[doc = "Request to control this MAV."]
32675 #[doc = ""]
32676 #[doc = "ID: 5"]
32677 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32678 #[doc = "Accept / deny control of this MAV."]
32679 #[doc = ""]
32680 #[doc = "ID: 6"]
32681 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32682 #[doc = "Information about a potential collision."]
32683 #[doc = ""]
32684 #[doc = "ID: 247"]
32685 COLLISION(COLLISION_DATA),
32686 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32687 #[doc = ""]
32688 #[doc = "ID: 77"]
32689 COMMAND_ACK(COMMAND_ACK_DATA),
32690 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32691 #[doc = ""]
32692 #[doc = "ID: 80"]
32693 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32694 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32695 #[doc = ""]
32696 #[doc = "ID: 75"]
32697 COMMAND_INT(COMMAND_INT_DATA),
32698 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32699 #[doc = ""]
32700 #[doc = "ID: 76"]
32701 COMMAND_LONG(COMMAND_LONG_DATA),
32702 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
32703 #[doc = ""]
32704 #[doc = "ID: 395"]
32705 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
32706 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
32707 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
32708 #[doc = ""]
32709 #[doc = "ID: 396"]
32710 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
32711 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
32712 #[doc = ""]
32713 #[doc = "ID: 397"]
32714 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
32715 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
32716 #[doc = ""]
32717 #[doc = "ID: 146"]
32718 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
32719 #[doc = "offset response to encapsulated data."]
32720 #[doc = ""]
32721 #[doc = "ID: 50005"]
32722 CUBEPILOT_FIRMWARE_UPDATE_RESP(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA),
32723 #[doc = "Start firmware update with encapsulated data."]
32724 #[doc = ""]
32725 #[doc = "ID: 50004"]
32726 CUBEPILOT_FIRMWARE_UPDATE_START(CUBEPILOT_FIRMWARE_UPDATE_START_DATA),
32727 #[doc = "Raw RC Data."]
32728 #[doc = ""]
32729 #[doc = "ID: 50001"]
32730 CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA),
32731 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
32732 #[doc = ""]
32733 #[doc = "ID: 411"]
32734 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
32735 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
32736 #[doc = ""]
32737 #[doc = "ID: 436"]
32738 CURRENT_MODE(CURRENT_MODE_DATA),
32739 #[doc = "Data stream status information."]
32740 #[doc = ""]
32741 #[doc = "ID: 67"]
32742 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
32743 DATA_STREAM(DATA_STREAM_DATA),
32744 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32745 #[doc = ""]
32746 #[doc = "ID: 130"]
32747 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
32748 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
32749 #[doc = ""]
32750 #[doc = "ID: 254"]
32751 DEBUG(DEBUG_DATA),
32752 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
32753 #[doc = ""]
32754 #[doc = "ID: 350"]
32755 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
32756 #[doc = "To debug something using a named 3D vector."]
32757 #[doc = ""]
32758 #[doc = "ID: 250"]
32759 DEBUG_VECT(DEBUG_VECT_DATA),
32760 #[doc = "Distance sensor information for an onboard rangefinder."]
32761 #[doc = ""]
32762 #[doc = "ID: 132"]
32763 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
32764 #[doc = "EFI status output."]
32765 #[doc = ""]
32766 #[doc = "ID: 225"]
32767 EFI_STATUS(EFI_STATUS_DATA),
32768 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32769 #[doc = ""]
32770 #[doc = "ID: 131"]
32771 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
32772 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
32773 #[doc = ""]
32774 #[doc = "ID: 290"]
32775 ESC_INFO(ESC_INFO_DATA),
32776 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
32777 #[doc = ""]
32778 #[doc = "ID: 291"]
32779 ESC_STATUS(ESC_STATUS_DATA),
32780 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
32781 #[doc = ""]
32782 #[doc = "ID: 230"]
32783 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
32784 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
32785 #[doc = ""]
32786 #[doc = "ID: 410"]
32787 EVENT(EVENT_DATA),
32788 #[doc = "Provides state for additional features."]
32789 #[doc = ""]
32790 #[doc = "ID: 245"]
32791 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
32792 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
32793 #[doc = ""]
32794 #[doc = "ID: 162"]
32795 FENCE_STATUS(FENCE_STATUS_DATA),
32796 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
32797 #[doc = ""]
32798 #[doc = "ID: 110"]
32799 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
32800 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
32801 #[doc = ""]
32802 #[doc = "ID: 264"]
32803 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
32804 #[doc = "Current motion information from a designated system."]
32805 #[doc = ""]
32806 #[doc = "ID: 144"]
32807 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
32808 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
32809 #[doc = ""]
32810 #[doc = "ID: 371"]
32811 FUEL_STATUS(FUEL_STATUS_DATA),
32812 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
32813 #[doc = ""]
32814 #[doc = "ID: 373"]
32815 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
32816 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
32817 #[doc = ""]
32818 #[doc = "ID: 285"]
32819 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
32820 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
32821 #[doc = ""]
32822 #[doc = "ID: 283"]
32823 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
32824 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
32825 #[doc = ""]
32826 #[doc = "ID: 284"]
32827 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
32828 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
32829 #[doc = ""]
32830 #[doc = "ID: 280"]
32831 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
32832 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32833 #[doc = ""]
32834 #[doc = "ID: 282"]
32835 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
32836 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32837 #[doc = ""]
32838 #[doc = "ID: 288"]
32839 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
32840 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
32841 #[doc = ""]
32842 #[doc = "ID: 287"]
32843 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
32844 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
32845 #[doc = ""]
32846 #[doc = "ID: 281"]
32847 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
32848 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
32849 #[doc = ""]
32850 #[doc = "ID: 33"]
32851 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
32852 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
32853 #[doc = ""]
32854 #[doc = "ID: 63"]
32855 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
32856 #[doc = "Global position/attitude estimate from a vision source."]
32857 #[doc = ""]
32858 #[doc = "ID: 101"]
32859 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
32860 #[doc = "Second GPS data."]
32861 #[doc = ""]
32862 #[doc = "ID: 124"]
32863 GPS2_RAW(GPS2_RAW_DATA),
32864 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32865 #[doc = ""]
32866 #[doc = "ID: 128"]
32867 GPS2_RTK(GPS2_RTK_DATA),
32868 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
32869 #[doc = ""]
32870 #[doc = "ID: 49"]
32871 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
32872 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
32873 #[doc = ""]
32874 #[doc = "ID: 123"]
32875 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
32876 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
32877 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
32878 #[doc = ""]
32879 #[doc = "ID: 232"]
32880 GPS_INPUT(GPS_INPUT_DATA),
32881 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32882 #[doc = ""]
32883 #[doc = "ID: 24"]
32884 GPS_RAW_INT(GPS_RAW_INT_DATA),
32885 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
32886 #[doc = ""]
32887 #[doc = "ID: 233"]
32888 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32889 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32890 #[doc = ""]
32891 #[doc = "ID: 127"]
32892 GPS_RTK(GPS_RTK_DATA),
32893 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
32894 #[doc = ""]
32895 #[doc = "ID: 25"]
32896 GPS_STATUS(GPS_STATUS_DATA),
32897 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
32898 #[doc = ""]
32899 #[doc = "ID: 0"]
32900 HEARTBEAT(HEARTBEAT_DATA),
32901 #[doc = "Herelink Telemetry."]
32902 #[doc = ""]
32903 #[doc = "ID: 50003"]
32904 HERELINK_TELEM(HERELINK_TELEM_DATA),
32905 #[doc = "Information about video stream."]
32906 #[doc = ""]
32907 #[doc = "ID: 50002"]
32908 HERELINK_VIDEO_STREAM_INFORMATION(HERELINK_VIDEO_STREAM_INFORMATION_DATA),
32909 #[doc = "The IMU readings in SI units in NED body frame."]
32910 #[doc = ""]
32911 #[doc = "ID: 105"]
32912 HIGHRES_IMU(HIGHRES_IMU_DATA),
32913 #[doc = "Message appropriate for high latency connections like Iridium."]
32914 #[doc = ""]
32915 #[doc = "ID: 234"]
32916 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32917 HIGH_LATENCY(HIGH_LATENCY_DATA),
32918 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
32919 #[doc = ""]
32920 #[doc = "ID: 235"]
32921 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32922 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
32923 #[doc = ""]
32924 #[doc = "ID: 93"]
32925 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32926 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
32927 #[doc = ""]
32928 #[doc = "ID: 91"]
32929 HIL_CONTROLS(HIL_CONTROLS_DATA),
32930 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32931 #[doc = ""]
32932 #[doc = "ID: 113"]
32933 HIL_GPS(HIL_GPS_DATA),
32934 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
32935 #[doc = ""]
32936 #[doc = "ID: 114"]
32937 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32938 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
32939 #[doc = ""]
32940 #[doc = "ID: 92"]
32941 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32942 #[doc = "The IMU readings in SI units in NED body frame."]
32943 #[doc = ""]
32944 #[doc = "ID: 107"]
32945 HIL_SENSOR(HIL_SENSOR_DATA),
32946 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32947 #[doc = ""]
32948 #[doc = "ID: 90"]
32949 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32950 HIL_STATE(HIL_STATE_DATA),
32951 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32952 #[doc = ""]
32953 #[doc = "ID: 115"]
32954 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32955 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
32956 #[doc = ""]
32957 #[doc = "ID: 242"]
32958 HOME_POSITION(HOME_POSITION_DATA),
32959 #[doc = "Temperature and humidity from hygrometer."]
32960 #[doc = ""]
32961 #[doc = "ID: 12920"]
32962 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32963 #[doc = "Illuminator status."]
32964 #[doc = ""]
32965 #[doc = "ID: 440"]
32966 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32967 #[doc = "Status of the Iridium SBD link."]
32968 #[doc = ""]
32969 #[doc = "ID: 335"]
32970 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32971 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
32972 #[doc = ""]
32973 #[doc = "ID: 149"]
32974 LANDING_TARGET(LANDING_TARGET_DATA),
32975 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
32976 #[doc = ""]
32977 #[doc = "ID: 8"]
32978 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32979 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32980 #[doc = ""]
32981 #[doc = "ID: 32"]
32982 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32983 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32984 #[doc = ""]
32985 #[doc = "ID: 64"]
32986 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32987 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32988 #[doc = ""]
32989 #[doc = "ID: 89"]
32990 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32991 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
32992 #[doc = ""]
32993 #[doc = "ID: 268"]
32994 LOGGING_ACK(LOGGING_ACK_DATA),
32995 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
32996 #[doc = ""]
32997 #[doc = "ID: 266"]
32998 LOGGING_DATA(LOGGING_DATA_DATA),
32999 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
33000 #[doc = ""]
33001 #[doc = "ID: 267"]
33002 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
33003 #[doc = "Reply to LOG_REQUEST_DATA."]
33004 #[doc = ""]
33005 #[doc = "ID: 120"]
33006 LOG_DATA(LOG_DATA_DATA),
33007 #[doc = "Reply to LOG_REQUEST_LIST."]
33008 #[doc = ""]
33009 #[doc = "ID: 118"]
33010 LOG_ENTRY(LOG_ENTRY_DATA),
33011 #[doc = "Erase all logs."]
33012 #[doc = ""]
33013 #[doc = "ID: 121"]
33014 LOG_ERASE(LOG_ERASE_DATA),
33015 #[doc = "Request a chunk of a log."]
33016 #[doc = ""]
33017 #[doc = "ID: 119"]
33018 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
33019 #[doc = "Stop log transfer and resume normal logging."]
33020 #[doc = ""]
33021 #[doc = "ID: 122"]
33022 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
33023 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
33024 #[doc = ""]
33025 #[doc = "ID: 117"]
33026 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
33027 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
33028 #[doc = ""]
33029 #[doc = "ID: 192"]
33030 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
33031 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
33032 #[doc = ""]
33033 #[doc = "ID: 69"]
33034 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
33035 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
33036 #[doc = ""]
33037 #[doc = "ID: 81"]
33038 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
33039 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33040 #[doc = ""]
33041 #[doc = "ID: 249"]
33042 MEMORY_VECT(MEMORY_VECT_DATA),
33043 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
33044 #[doc = ""]
33045 #[doc = "ID: 244"]
33046 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
33047 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
33048 #[doc = ""]
33049 #[doc = "ID: 47"]
33050 MISSION_ACK(MISSION_ACK_DATA),
33051 #[doc = "Delete all mission items at once."]
33052 #[doc = ""]
33053 #[doc = "ID: 45"]
33054 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
33055 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
33056 #[doc = ""]
33057 #[doc = "ID: 44"]
33058 MISSION_COUNT(MISSION_COUNT_DATA),
33059 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
33060 #[doc = ""]
33061 #[doc = "ID: 42"]
33062 MISSION_CURRENT(MISSION_CURRENT_DATA),
33063 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33064 #[doc = ""]
33065 #[doc = "ID: 39"]
33066 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
33067 MISSION_ITEM(MISSION_ITEM_DATA),
33068 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33069 #[doc = ""]
33070 #[doc = "ID: 73"]
33071 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
33072 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
33073 #[doc = ""]
33074 #[doc = "ID: 46"]
33075 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
33076 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
33077 #[doc = ""]
33078 #[doc = "ID: 40"]
33079 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
33080 MISSION_REQUEST(MISSION_REQUEST_DATA),
33081 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
33082 #[doc = ""]
33083 #[doc = "ID: 51"]
33084 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33085 #[doc = "Request the overall list of mission items from the system/component."]
33086 #[doc = ""]
33087 #[doc = "ID: 43"]
33088 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33089 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
33090 #[doc = ""]
33091 #[doc = "ID: 37"]
33092 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33093 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
33094 #[doc = ""]
33095 #[doc = "ID: 41"]
33096 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33097 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33098 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
33099 #[doc = ""]
33100 #[doc = "ID: 38"]
33101 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33102 #[doc = "Orientation of a mount."]
33103 #[doc = ""]
33104 #[doc = "ID: 265"]
33105 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33106 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33107 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33108 #[doc = ""]
33109 #[doc = "ID: 251"]
33110 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33111 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33112 #[doc = ""]
33113 #[doc = "ID: 252"]
33114 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33115 #[doc = "The state of the navigation and position controller."]
33116 #[doc = ""]
33117 #[doc = "ID: 62"]
33118 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33119 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
33120 #[doc = ""]
33121 #[doc = "ID: 330"]
33122 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33123 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
33124 #[doc = ""]
33125 #[doc = "ID: 331"]
33126 ODOMETRY(ODOMETRY_DATA),
33127 #[doc = "Hardware status sent by an onboard computer."]
33128 #[doc = ""]
33129 #[doc = "ID: 390"]
33130 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33131 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
33132 #[doc = ""]
33133 #[doc = "ID: 12918"]
33134 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33135 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
33136 #[doc = ""]
33137 #[doc = "ID: 12902"]
33138 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33139 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
33140 #[doc = ""]
33141 #[doc = "ID: 12900"]
33142 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33143 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
33144 #[doc = ""]
33145 #[doc = "ID: 12901"]
33146 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33147 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
33148 #[doc = ""]
33149 #[doc = "ID: 12915"]
33150 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33151 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
33152 #[doc = ""]
33153 #[doc = "ID: 12905"]
33154 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33155 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
33156 #[doc = ""]
33157 #[doc = "ID: 12903"]
33158 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33159 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
33160 #[doc = ""]
33161 #[doc = "ID: 12904"]
33162 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33163 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
33164 #[doc = ""]
33165 #[doc = "ID: 12919"]
33166 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33167 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
33168 #[doc = ""]
33169 #[doc = "ID: 100"]
33170 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33171 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
33172 #[doc = ""]
33173 #[doc = "ID: 106"]
33174 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33175 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
33176 #[doc = ""]
33177 #[doc = "ID: 360"]
33178 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33179 #[doc = "Response from a PARAM_EXT_SET message."]
33180 #[doc = ""]
33181 #[doc = "ID: 324"]
33182 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33183 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
33184 #[doc = ""]
33185 #[doc = "ID: 321"]
33186 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33187 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
33188 #[doc = ""]
33189 #[doc = "ID: 320"]
33190 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33191 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
33192 #[doc = ""]
33193 #[doc = "ID: 323"]
33194 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33195 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
33196 #[doc = ""]
33197 #[doc = "ID: 322"]
33198 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33199 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
33200 #[doc = ""]
33201 #[doc = "ID: 50"]
33202 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33203 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33204 #[doc = ""]
33205 #[doc = "ID: 21"]
33206 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33207 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
33208 #[doc = ""]
33209 #[doc = "ID: 20"]
33210 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33211 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33212 #[doc = ""]
33213 #[doc = "ID: 23"]
33214 PARAM_SET(PARAM_SET_DATA),
33215 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33216 #[doc = ""]
33217 #[doc = "ID: 22"]
33218 PARAM_VALUE(PARAM_VALUE_DATA),
33219 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
33220 #[doc = ""]
33221 #[doc = "ID: 4"]
33222 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33223 PING(PING_DATA),
33224 #[doc = "Control vehicle tone generation (buzzer)."]
33225 #[doc = ""]
33226 #[doc = "ID: 258"]
33227 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33228 PLAY_TUNE(PLAY_TUNE_DATA),
33229 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
33230 #[doc = ""]
33231 #[doc = "ID: 400"]
33232 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33233 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
33234 #[doc = ""]
33235 #[doc = "ID: 87"]
33236 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33237 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
33238 #[doc = ""]
33239 #[doc = "ID: 85"]
33240 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33241 #[doc = "Power supply status."]
33242 #[doc = ""]
33243 #[doc = "ID: 125"]
33244 POWER_STATUS(POWER_STATUS_DATA),
33245 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
33246 #[doc = ""]
33247 #[doc = "ID: 300"]
33248 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33249 #[doc = "Status generated by radio and injected into MAVLink stream."]
33250 #[doc = ""]
33251 #[doc = "ID: 109"]
33252 RADIO_STATUS(RADIO_STATUS_DATA),
33253 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33254 #[doc = ""]
33255 #[doc = "ID: 27"]
33256 RAW_IMU(RAW_IMU_DATA),
33257 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33258 #[doc = ""]
33259 #[doc = "ID: 28"]
33260 RAW_PRESSURE(RAW_PRESSURE_DATA),
33261 #[doc = "RPM sensor data message."]
33262 #[doc = ""]
33263 #[doc = "ID: 339"]
33264 RAW_RPM(RAW_RPM_DATA),
33265 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33266 #[doc = ""]
33267 #[doc = "ID: 65"]
33268 RC_CHANNELS(RC_CHANNELS_DATA),
33269 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33270 #[doc = ""]
33271 #[doc = "ID: 70"]
33272 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33273 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33274 #[doc = ""]
33275 #[doc = "ID: 35"]
33276 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33277 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33278 #[doc = ""]
33279 #[doc = "ID: 34"]
33280 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33281 #[doc = "Request a data stream."]
33282 #[doc = ""]
33283 #[doc = "ID: 66"]
33284 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33285 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33286 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
33287 #[doc = ""]
33288 #[doc = "ID: 412"]
33289 REQUEST_EVENT(REQUEST_EVENT_DATA),
33290 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
33291 #[doc = ""]
33292 #[doc = "ID: 142"]
33293 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33294 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
33295 #[doc = ""]
33296 #[doc = "ID: 413"]
33297 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33298 #[doc = "Read out the safety zone the MAV currently assumes."]
33299 #[doc = ""]
33300 #[doc = "ID: 55"]
33301 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33302 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
33303 #[doc = ""]
33304 #[doc = "ID: 54"]
33305 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33306 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
33307 #[doc = ""]
33308 #[doc = "ID: 26"]
33309 SCALED_IMU(SCALED_IMU_DATA),
33310 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
33311 #[doc = ""]
33312 #[doc = "ID: 116"]
33313 SCALED_IMU2(SCALED_IMU2_DATA),
33314 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
33315 #[doc = ""]
33316 #[doc = "ID: 129"]
33317 SCALED_IMU3(SCALED_IMU3_DATA),
33318 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
33319 #[doc = ""]
33320 #[doc = "ID: 29"]
33321 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33322 #[doc = "Barometer readings for 2nd barometer."]
33323 #[doc = ""]
33324 #[doc = "ID: 137"]
33325 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33326 #[doc = "Barometer readings for 3rd barometer."]
33327 #[doc = ""]
33328 #[doc = "ID: 143"]
33329 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33330 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
33331 #[doc = ""]
33332 #[doc = "ID: 126"]
33333 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33334 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
33335 #[doc = ""]
33336 #[doc = "ID: 36"]
33337 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33338 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
33339 #[doc = ""]
33340 #[doc = "ID: 256"]
33341 SETUP_SIGNING(SETUP_SIGNING_DATA),
33342 #[doc = "Set the vehicle attitude and body angular rates."]
33343 #[doc = ""]
33344 #[doc = "ID: 139"]
33345 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33346 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
33347 #[doc = ""]
33348 #[doc = "ID: 82"]
33349 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33350 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
33351 #[doc = ""]
33352 #[doc = "ID: 48"]
33353 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33354 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33355 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
33356 #[doc = ""]
33357 #[doc = "ID: 243"]
33358 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33359 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33360 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
33361 #[doc = ""]
33362 #[doc = "ID: 11"]
33363 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33364 SET_MODE(SET_MODE_DATA),
33365 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
33366 #[doc = ""]
33367 #[doc = "ID: 86"]
33368 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33369 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
33370 #[doc = ""]
33371 #[doc = "ID: 84"]
33372 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33373 #[doc = "Status of simulation environment, if used."]
33374 #[doc = ""]
33375 #[doc = "ID: 108"]
33376 SIM_STATE(SIM_STATE_DATA),
33377 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
33378 #[doc = ""]
33379 #[doc = "ID: 370"]
33380 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33381 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33382 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
33383 #[doc = ""]
33384 #[doc = "ID: 253"]
33385 STATUSTEXT(STATUSTEXT_DATA),
33386 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
33387 #[doc = ""]
33388 #[doc = "ID: 261"]
33389 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33390 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
33391 #[doc = ""]
33392 #[doc = "ID: 401"]
33393 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33394 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
33395 #[doc = ""]
33396 #[doc = "ID: 2"]
33397 SYSTEM_TIME(SYSTEM_TIME_DATA),
33398 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
33399 #[doc = ""]
33400 #[doc = "ID: 1"]
33401 SYS_STATUS(SYS_STATUS_DATA),
33402 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
33403 #[doc = ""]
33404 #[doc = "ID: 135"]
33405 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33406 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33407 #[doc = ""]
33408 #[doc = "ID: 134"]
33409 TERRAIN_DATA(TERRAIN_DATA_DATA),
33410 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33411 #[doc = ""]
33412 #[doc = "ID: 136"]
33413 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33414 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33415 #[doc = ""]
33416 #[doc = "ID: 133"]
33417 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33418 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
33419 #[doc = ""]
33420 #[doc = "ID: 111"]
33421 TIMESYNC(TIMESYNC_DATA),
33422 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
33423 #[doc = ""]
33424 #[doc = "ID: 380"]
33425 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33426 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
33427 #[doc = ""]
33428 #[doc = "ID: 333"]
33429 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33430 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
33431 #[doc = ""]
33432 #[doc = "ID: 332"]
33433 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33434 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33435 #[doc = ""]
33436 #[doc = "ID: 385"]
33437 TUNNEL(TUNNEL_DATA),
33438 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33439 #[doc = ""]
33440 #[doc = "ID: 311"]
33441 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33442 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33443 #[doc = ""]
33444 #[doc = "ID: 310"]
33445 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33446 #[doc = "The global position resulting from GPS and sensor fusion."]
33447 #[doc = ""]
33448 #[doc = "ID: 340"]
33449 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33450 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33451 #[doc = ""]
33452 #[doc = "ID: 248"]
33453 V2_EXTENSION(V2_EXTENSION_DATA),
33454 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33455 #[doc = ""]
33456 #[doc = "ID: 74"]
33457 VFR_HUD(VFR_HUD_DATA),
33458 #[doc = "Vibration levels and accelerometer clipping."]
33459 #[doc = ""]
33460 #[doc = "ID: 241"]
33461 VIBRATION(VIBRATION_DATA),
33462 #[doc = "Global position estimate from a Vicon motion system source."]
33463 #[doc = ""]
33464 #[doc = "ID: 104"]
33465 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33466 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33467 #[doc = ""]
33468 #[doc = "ID: 269"]
33469 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33470 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33471 #[doc = ""]
33472 #[doc = "ID: 270"]
33473 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33474 #[doc = "Local position/attitude estimate from a vision source."]
33475 #[doc = ""]
33476 #[doc = "ID: 102"]
33477 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33478 #[doc = "Speed estimate from a vision source."]
33479 #[doc = ""]
33480 #[doc = "ID: 103"]
33481 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33482 #[doc = "Cumulative distance traveled for each reported wheel."]
33483 #[doc = ""]
33484 #[doc = "ID: 9000"]
33485 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33486 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33487 #[doc = ""]
33488 #[doc = "ID: 299"]
33489 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33490 #[doc = "Winch status."]
33491 #[doc = ""]
33492 #[doc = "ID: 9005"]
33493 WINCH_STATUS(WINCH_STATUS_DATA),
33494 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33495 #[doc = ""]
33496 #[doc = "ID: 231"]
33497 WIND_COV(WIND_COV_DATA),
33498}
33499impl MavMessage {
33500 pub const fn all_ids() -> &'static [u32] {
33501 &[
33502 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33503 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33504 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33505 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33506 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33507 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33508 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33509 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33510 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33511 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33512 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
33513 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
33514 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
33515 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
33516 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
33517 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
33518 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
33519 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
33520 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
33521 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
33522 12915u32, 12918u32, 12919u32, 12920u32, 50001u32, 50002u32, 50003u32, 50004u32,
33523 50005u32,
33524 ]
33525 }
33526}
33527impl Message for MavMessage {
33528 fn parse(
33529 version: MavlinkVersion,
33530 id: u32,
33531 payload: &[u8],
33532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33533 match id {
33534 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33535 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33536 .map(Self::ACTUATOR_CONTROL_TARGET)
33537 }
33538 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33539 .map(Self::ACTUATOR_OUTPUT_STATUS),
33540 ADSB_VEHICLE_DATA::ID => {
33541 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33542 }
33543 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33544 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33545 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33546 ATTITUDE_QUATERNION_DATA::ID => {
33547 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33548 }
33549 ATTITUDE_QUATERNION_COV_DATA::ID => {
33550 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33551 .map(Self::ATTITUDE_QUATERNION_COV)
33552 }
33553 ATTITUDE_TARGET_DATA::ID => {
33554 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33555 }
33556 ATT_POS_MOCAP_DATA::ID => {
33557 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33558 }
33559 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33560 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33561 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33562 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33563 }
33564 AUTOPILOT_VERSION_DATA::ID => {
33565 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33566 }
33567 AVAILABLE_MODES_DATA::ID => {
33568 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33569 }
33570 AVAILABLE_MODES_MONITOR_DATA::ID => {
33571 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33572 .map(Self::AVAILABLE_MODES_MONITOR)
33573 }
33574 BATTERY_INFO_DATA::ID => {
33575 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33576 }
33577 BATTERY_STATUS_DATA::ID => {
33578 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33579 }
33580 BUTTON_CHANGE_DATA::ID => {
33581 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33582 }
33583 CAMERA_CAPTURE_STATUS_DATA::ID => {
33584 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33585 }
33586 CAMERA_FOV_STATUS_DATA::ID => {
33587 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33588 }
33589 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33590 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33591 }
33592 CAMERA_INFORMATION_DATA::ID => {
33593 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33594 }
33595 CAMERA_SETTINGS_DATA::ID => {
33596 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33597 }
33598 CAMERA_THERMAL_RANGE_DATA::ID => {
33599 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33600 }
33601 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33602 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33603 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33604 }
33605 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33606 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33607 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33608 }
33609 CAMERA_TRIGGER_DATA::ID => {
33610 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33611 }
33612 CANFD_FRAME_DATA::ID => {
33613 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33614 }
33615 CAN_FILTER_MODIFY_DATA::ID => {
33616 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33617 }
33618 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33619 CELLULAR_CONFIG_DATA::ID => {
33620 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33621 }
33622 CELLULAR_STATUS_DATA::ID => {
33623 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33624 }
33625 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33626 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33627 .map(Self::CHANGE_OPERATOR_CONTROL)
33628 }
33629 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33630 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33631 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33632 }
33633 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33634 COMMAND_ACK_DATA::ID => {
33635 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33636 }
33637 COMMAND_CANCEL_DATA::ID => {
33638 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33639 }
33640 COMMAND_INT_DATA::ID => {
33641 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33642 }
33643 COMMAND_LONG_DATA::ID => {
33644 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33645 }
33646 COMPONENT_INFORMATION_DATA::ID => {
33647 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33648 }
33649 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33650 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33651 .map(Self::COMPONENT_INFORMATION_BASIC)
33652 }
33653 COMPONENT_METADATA_DATA::ID => {
33654 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33655 }
33656 CONTROL_SYSTEM_STATE_DATA::ID => {
33657 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33658 }
33659 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
33660 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::deser(version, payload)
33661 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP)
33662 }
33663 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
33664 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::deser(version, payload)
33665 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_START)
33666 }
33667 CUBEPILOT_RAW_RC_DATA::ID => {
33668 CUBEPILOT_RAW_RC_DATA::deser(version, payload).map(Self::CUBEPILOT_RAW_RC)
33669 }
33670 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33671 .map(Self::CURRENT_EVENT_SEQUENCE),
33672 CURRENT_MODE_DATA::ID => {
33673 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33674 }
33675 DATA_STREAM_DATA::ID => {
33676 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33677 }
33678 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33679 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33680 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33681 }
33682 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33683 DEBUG_FLOAT_ARRAY_DATA::ID => {
33684 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33685 }
33686 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33687 DISTANCE_SENSOR_DATA::ID => {
33688 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33689 }
33690 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33691 ENCAPSULATED_DATA_DATA::ID => {
33692 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33693 }
33694 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33695 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33696 ESTIMATOR_STATUS_DATA::ID => {
33697 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33698 }
33699 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33700 EXTENDED_SYS_STATE_DATA::ID => {
33701 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33702 }
33703 FENCE_STATUS_DATA::ID => {
33704 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33705 }
33706 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33707 .map(Self::FILE_TRANSFER_PROTOCOL),
33708 FLIGHT_INFORMATION_DATA::ID => {
33709 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33710 }
33711 FOLLOW_TARGET_DATA::ID => {
33712 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33713 }
33714 FUEL_STATUS_DATA::ID => {
33715 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
33716 }
33717 GENERATOR_STATUS_DATA::ID => {
33718 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
33719 }
33720 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
33721 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
33722 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
33723 }
33724 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
33725 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
33726 .map(Self::GIMBAL_DEVICE_INFORMATION)
33727 }
33728 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
33729 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
33730 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
33731 }
33732 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
33733 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
33734 .map(Self::GIMBAL_MANAGER_INFORMATION)
33735 }
33736 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
33737 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
33738 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
33739 }
33740 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33741 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
33742 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
33743 }
33744 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
33745 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
33746 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
33747 }
33748 GIMBAL_MANAGER_STATUS_DATA::ID => {
33749 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
33750 }
33751 GLOBAL_POSITION_INT_DATA::ID => {
33752 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
33753 }
33754 GLOBAL_POSITION_INT_COV_DATA::ID => {
33755 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
33756 .map(Self::GLOBAL_POSITION_INT_COV)
33757 }
33758 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33759 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33760 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
33761 }
33762 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
33763 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
33764 GPS_GLOBAL_ORIGIN_DATA::ID => {
33765 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
33766 }
33767 GPS_INJECT_DATA_DATA::ID => {
33768 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
33769 }
33770 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
33771 GPS_RAW_INT_DATA::ID => {
33772 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
33773 }
33774 GPS_RTCM_DATA_DATA::ID => {
33775 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
33776 }
33777 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
33778 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
33779 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
33780 HERELINK_TELEM_DATA::ID => {
33781 HERELINK_TELEM_DATA::deser(version, payload).map(Self::HERELINK_TELEM)
33782 }
33783 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
33784 HERELINK_VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
33785 .map(Self::HERELINK_VIDEO_STREAM_INFORMATION)
33786 }
33787 HIGHRES_IMU_DATA::ID => {
33788 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
33789 }
33790 HIGH_LATENCY_DATA::ID => {
33791 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
33792 }
33793 HIGH_LATENCY2_DATA::ID => {
33794 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
33795 }
33796 HIL_ACTUATOR_CONTROLS_DATA::ID => {
33797 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
33798 }
33799 HIL_CONTROLS_DATA::ID => {
33800 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
33801 }
33802 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
33803 HIL_OPTICAL_FLOW_DATA::ID => {
33804 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
33805 }
33806 HIL_RC_INPUTS_RAW_DATA::ID => {
33807 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
33808 }
33809 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
33810 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
33811 HIL_STATE_QUATERNION_DATA::ID => {
33812 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
33813 }
33814 HOME_POSITION_DATA::ID => {
33815 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
33816 }
33817 HYGROMETER_SENSOR_DATA::ID => {
33818 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
33819 }
33820 ILLUMINATOR_STATUS_DATA::ID => {
33821 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
33822 }
33823 ISBD_LINK_STATUS_DATA::ID => {
33824 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
33825 }
33826 LANDING_TARGET_DATA::ID => {
33827 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
33828 }
33829 LINK_NODE_STATUS_DATA::ID => {
33830 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
33831 }
33832 LOCAL_POSITION_NED_DATA::ID => {
33833 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
33834 }
33835 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
33836 .map(Self::LOCAL_POSITION_NED_COV),
33837 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33838 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
33839 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
33840 }
33841 LOGGING_ACK_DATA::ID => {
33842 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
33843 }
33844 LOGGING_DATA_DATA::ID => {
33845 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
33846 }
33847 LOGGING_DATA_ACKED_DATA::ID => {
33848 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
33849 }
33850 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
33851 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
33852 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
33853 LOG_REQUEST_DATA_DATA::ID => {
33854 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33855 }
33856 LOG_REQUEST_END_DATA::ID => {
33857 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33858 }
33859 LOG_REQUEST_LIST_DATA::ID => {
33860 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33861 }
33862 MAG_CAL_REPORT_DATA::ID => {
33863 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33864 }
33865 MANUAL_CONTROL_DATA::ID => {
33866 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33867 }
33868 MANUAL_SETPOINT_DATA::ID => {
33869 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33870 }
33871 MEMORY_VECT_DATA::ID => {
33872 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33873 }
33874 MESSAGE_INTERVAL_DATA::ID => {
33875 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33876 }
33877 MISSION_ACK_DATA::ID => {
33878 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33879 }
33880 MISSION_CLEAR_ALL_DATA::ID => {
33881 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33882 }
33883 MISSION_COUNT_DATA::ID => {
33884 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33885 }
33886 MISSION_CURRENT_DATA::ID => {
33887 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33888 }
33889 MISSION_ITEM_DATA::ID => {
33890 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33891 }
33892 MISSION_ITEM_INT_DATA::ID => {
33893 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33894 }
33895 MISSION_ITEM_REACHED_DATA::ID => {
33896 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33897 }
33898 MISSION_REQUEST_DATA::ID => {
33899 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33900 }
33901 MISSION_REQUEST_INT_DATA::ID => {
33902 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33903 }
33904 MISSION_REQUEST_LIST_DATA::ID => {
33905 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33906 }
33907 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33908 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33909 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33910 }
33911 MISSION_SET_CURRENT_DATA::ID => {
33912 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33913 }
33914 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33915 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33916 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33917 }
33918 MOUNT_ORIENTATION_DATA::ID => {
33919 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33920 }
33921 NAMED_VALUE_FLOAT_DATA::ID => {
33922 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33923 }
33924 NAMED_VALUE_INT_DATA::ID => {
33925 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33926 }
33927 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33928 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33929 }
33930 OBSTACLE_DISTANCE_DATA::ID => {
33931 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33932 }
33933 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33934 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33935 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33936 .map(Self::ONBOARD_COMPUTER_STATUS)
33937 }
33938 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33939 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33940 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33941 }
33942 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33943 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33944 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33945 }
33946 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33947 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33948 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33949 .map(Self::OPEN_DRONE_ID_LOCATION),
33950 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33951 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33952 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33953 }
33954 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33955 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33956 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33957 }
33958 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33959 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33960 }
33961 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33962 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33963 }
33964 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33965 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33966 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33967 }
33968 OPTICAL_FLOW_DATA::ID => {
33969 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33970 }
33971 OPTICAL_FLOW_RAD_DATA::ID => {
33972 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33973 }
33974 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33975 .map(Self::ORBIT_EXECUTION_STATUS),
33976 PARAM_EXT_ACK_DATA::ID => {
33977 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33978 }
33979 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33980 .map(Self::PARAM_EXT_REQUEST_LIST),
33981 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33982 .map(Self::PARAM_EXT_REQUEST_READ),
33983 PARAM_EXT_SET_DATA::ID => {
33984 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33985 }
33986 PARAM_EXT_VALUE_DATA::ID => {
33987 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33988 }
33989 PARAM_MAP_RC_DATA::ID => {
33990 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33991 }
33992 PARAM_REQUEST_LIST_DATA::ID => {
33993 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33994 }
33995 PARAM_REQUEST_READ_DATA::ID => {
33996 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33997 }
33998 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33999 PARAM_VALUE_DATA::ID => {
34000 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
34001 }
34002 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
34003 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
34004 PLAY_TUNE_V2_DATA::ID => {
34005 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
34006 }
34007 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34008 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34009 .map(Self::POSITION_TARGET_GLOBAL_INT)
34010 }
34011 POSITION_TARGET_LOCAL_NED_DATA::ID => {
34012 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34013 .map(Self::POSITION_TARGET_LOCAL_NED)
34014 }
34015 POWER_STATUS_DATA::ID => {
34016 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
34017 }
34018 PROTOCOL_VERSION_DATA::ID => {
34019 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
34020 }
34021 RADIO_STATUS_DATA::ID => {
34022 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
34023 }
34024 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
34025 RAW_PRESSURE_DATA::ID => {
34026 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
34027 }
34028 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
34029 RC_CHANNELS_DATA::ID => {
34030 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
34031 }
34032 RC_CHANNELS_OVERRIDE_DATA::ID => {
34033 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
34034 }
34035 RC_CHANNELS_RAW_DATA::ID => {
34036 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
34037 }
34038 RC_CHANNELS_SCALED_DATA::ID => {
34039 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
34040 }
34041 REQUEST_DATA_STREAM_DATA::ID => {
34042 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
34043 }
34044 REQUEST_EVENT_DATA::ID => {
34045 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
34046 }
34047 RESOURCE_REQUEST_DATA::ID => {
34048 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
34049 }
34050 RESPONSE_EVENT_ERROR_DATA::ID => {
34051 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
34052 }
34053 SAFETY_ALLOWED_AREA_DATA::ID => {
34054 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
34055 }
34056 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
34057 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
34058 .map(Self::SAFETY_SET_ALLOWED_AREA)
34059 }
34060 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
34061 SCALED_IMU2_DATA::ID => {
34062 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
34063 }
34064 SCALED_IMU3_DATA::ID => {
34065 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
34066 }
34067 SCALED_PRESSURE_DATA::ID => {
34068 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
34069 }
34070 SCALED_PRESSURE2_DATA::ID => {
34071 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
34072 }
34073 SCALED_PRESSURE3_DATA::ID => {
34074 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
34075 }
34076 SERIAL_CONTROL_DATA::ID => {
34077 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
34078 }
34079 SERVO_OUTPUT_RAW_DATA::ID => {
34080 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
34081 }
34082 SETUP_SIGNING_DATA::ID => {
34083 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
34084 }
34085 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
34086 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
34087 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
34088 }
34089 SET_ATTITUDE_TARGET_DATA::ID => {
34090 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
34091 }
34092 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
34093 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
34094 }
34095 SET_HOME_POSITION_DATA::ID => {
34096 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
34097 }
34098 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
34099 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34100 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34101 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
34102 }
34103 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
34104 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34105 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
34106 }
34107 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
34108 SMART_BATTERY_INFO_DATA::ID => {
34109 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
34110 }
34111 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
34112 STORAGE_INFORMATION_DATA::ID => {
34113 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
34114 }
34115 SUPPORTED_TUNES_DATA::ID => {
34116 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
34117 }
34118 SYSTEM_TIME_DATA::ID => {
34119 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
34120 }
34121 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
34122 TERRAIN_CHECK_DATA::ID => {
34123 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
34124 }
34125 TERRAIN_DATA_DATA::ID => {
34126 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
34127 }
34128 TERRAIN_REPORT_DATA::ID => {
34129 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
34130 }
34131 TERRAIN_REQUEST_DATA::ID => {
34132 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
34133 }
34134 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
34135 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
34136 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
34137 .map(Self::TIME_ESTIMATE_TO_TARGET)
34138 }
34139 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34140 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
34141 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
34142 }
34143 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34144 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
34145 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
34146 }
34147 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
34148 UAVCAN_NODE_INFO_DATA::ID => {
34149 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
34150 }
34151 UAVCAN_NODE_STATUS_DATA::ID => {
34152 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
34153 }
34154 UTM_GLOBAL_POSITION_DATA::ID => {
34155 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
34156 }
34157 V2_EXTENSION_DATA::ID => {
34158 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
34159 }
34160 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
34161 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
34162 VICON_POSITION_ESTIMATE_DATA::ID => {
34163 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
34164 .map(Self::VICON_POSITION_ESTIMATE)
34165 }
34166 VIDEO_STREAM_INFORMATION_DATA::ID => {
34167 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
34168 .map(Self::VIDEO_STREAM_INFORMATION)
34169 }
34170 VIDEO_STREAM_STATUS_DATA::ID => {
34171 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
34172 }
34173 VISION_POSITION_ESTIMATE_DATA::ID => {
34174 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34175 .map(Self::VISION_POSITION_ESTIMATE)
34176 }
34177 VISION_SPEED_ESTIMATE_DATA::ID => {
34178 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
34179 }
34180 WHEEL_DISTANCE_DATA::ID => {
34181 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
34182 }
34183 WIFI_CONFIG_AP_DATA::ID => {
34184 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
34185 }
34186 WINCH_STATUS_DATA::ID => {
34187 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
34188 }
34189 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
34190 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
34191 }
34192 }
34193 fn message_name(&self) -> &'static str {
34194 match self {
34195 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
34196 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34197 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
34198 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
34199 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
34200 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
34201 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
34202 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
34203 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
34204 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
34205 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
34206 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34207 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
34208 }
34209 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
34210 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
34211 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
34212 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
34213 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
34214 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
34215 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
34216 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
34217 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
34218 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
34219 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
34220 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
34221 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34222 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34223 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
34224 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
34225 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
34226 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
34227 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
34228 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
34229 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
34230 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34231 Self::COLLISION(..) => COLLISION_DATA::NAME,
34232 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
34233 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
34234 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
34235 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
34236 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
34237 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
34238 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
34239 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
34240 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME,
34241 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME,
34242 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::NAME,
34243 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
34244 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
34245 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
34246 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34247 Self::DEBUG(..) => DEBUG_DATA::NAME,
34248 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
34249 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
34250 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
34251 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
34252 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
34253 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
34254 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
34255 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
34256 Self::EVENT(..) => EVENT_DATA::NAME,
34257 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
34258 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
34259 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
34260 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
34261 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
34262 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
34263 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
34264 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34265 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34266 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34267 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34268 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34269 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34270 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
34271 }
34272 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34273 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
34274 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
34275 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
34276 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34277 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
34278 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
34279 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
34280 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
34281 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
34282 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
34283 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
34284 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
34285 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
34286 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
34287 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::NAME,
34288 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
34289 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME
34290 }
34291 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
34292 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
34293 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
34294 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
34295 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
34296 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
34297 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
34298 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
34299 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
34300 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
34301 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
34302 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
34303 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
34304 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
34305 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
34306 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
34307 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
34308 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
34309 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
34310 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34311 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
34312 }
34313 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
34314 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
34315 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
34316 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
34317 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
34318 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
34319 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
34320 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
34321 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
34322 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
34323 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
34324 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
34325 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
34326 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
34327 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
34328 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
34329 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
34330 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
34331 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
34332 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
34333 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
34334 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
34335 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
34336 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
34337 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34338 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
34339 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34340 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
34341 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
34342 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
34343 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
34344 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
34345 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
34346 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
34347 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34348 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34349 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34350 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
34351 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34352 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34353 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34354 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34355 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34356 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
34357 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
34358 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
34359 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
34360 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
34361 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
34362 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
34363 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
34364 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
34365 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
34366 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
34367 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
34368 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
34369 Self::PING(..) => PING_DATA::NAME,
34370 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
34371 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
34372 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34373 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
34374 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
34375 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
34376 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
34377 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
34378 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
34379 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
34380 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
34381 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
34382 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
34383 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
34384 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
34385 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
34386 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
34387 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
34388 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
34389 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34390 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
34391 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
34392 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
34393 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
34394 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
34395 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
34396 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
34397 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
34398 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
34399 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34400 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
34401 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34402 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
34403 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
34404 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34405 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34406 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
34407 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
34408 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
34409 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
34410 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
34411 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
34412 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
34413 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
34414 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
34415 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
34416 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
34417 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
34418 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34419 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
34420 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
34421 }
34422 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34423 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
34424 }
34425 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
34426 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
34427 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
34428 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
34429 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
34430 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
34431 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
34432 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
34433 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
34434 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
34435 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
34436 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
34437 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34438 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34439 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34440 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34441 }
34442 }
34443 fn message_id(&self) -> u32 {
34444 match self {
34445 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34446 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34447 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34448 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34449 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34450 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34451 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34452 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34453 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34454 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34455 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34456 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34457 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34458 }
34459 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34460 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34461 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34462 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34463 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34464 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34465 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34466 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34467 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34468 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34469 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34470 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34471 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34472 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34473 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34474 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34475 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34476 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34477 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34478 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34479 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34480 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34481 Self::COLLISION(..) => COLLISION_DATA::ID,
34482 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34483 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34484 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34485 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34486 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34487 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34488 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34489 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34490 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID,
34491 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID,
34492 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::ID,
34493 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34494 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34495 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34496 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34497 Self::DEBUG(..) => DEBUG_DATA::ID,
34498 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34499 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34500 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34501 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34502 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34503 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34504 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34505 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34506 Self::EVENT(..) => EVENT_DATA::ID,
34507 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34508 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34509 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34510 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34511 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34512 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34513 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34514 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34515 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34516 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34517 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34518 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34519 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34520 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34521 }
34522 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34523 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34524 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34525 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34526 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34527 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34528 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34529 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34530 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34531 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34532 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34533 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34534 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34535 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34536 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34537 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::ID,
34538 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
34539 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID
34540 }
34541 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34542 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34543 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34544 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34545 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34546 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34547 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34548 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34549 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34550 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34551 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34552 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34553 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34554 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34555 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34556 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34557 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34558 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34559 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34560 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34561 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34562 }
34563 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34564 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34565 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34566 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34567 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34568 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34569 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34570 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34571 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34572 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34573 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34574 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34575 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34576 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34577 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34578 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34579 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34580 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34581 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34582 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34583 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34584 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34585 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34586 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34587 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34588 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34589 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34590 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34591 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34592 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34593 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34594 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34595 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34596 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34597 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34598 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34599 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34600 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34601 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34602 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34603 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34604 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34605 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34606 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34607 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34608 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34609 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34610 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34611 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34612 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34613 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34614 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34615 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34616 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34617 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34618 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34619 Self::PING(..) => PING_DATA::ID,
34620 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34621 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34622 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34623 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34624 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34625 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34626 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34627 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34628 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34629 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34630 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34631 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34632 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34633 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34634 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34635 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34636 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34637 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34638 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34639 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34640 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34641 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34642 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34643 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34644 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34645 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34646 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34647 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34648 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34649 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34650 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34651 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34652 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34653 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34654 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34655 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34656 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34657 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34658 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34659 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34660 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34661 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34662 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34663 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34664 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34665 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34666 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34667 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34668 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34669 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34670 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34671 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34672 }
34673 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34674 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34675 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34676 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34677 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34678 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34679 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34680 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34681 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34682 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34683 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34684 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34685 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34686 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34687 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34688 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34689 }
34690 }
34691 fn message_id_from_name(name: &str) -> Option<u32> {
34692 match name {
34693 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34694 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34695 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34696 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34697 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34698 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34699 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34700 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34701 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34702 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34703 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34704 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34705 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34706 }
34707 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34708 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34709 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34710 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
34711 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
34712 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
34713 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
34714 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
34715 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
34716 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
34717 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
34718 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
34719 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
34720 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
34721 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
34722 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
34723 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
34724 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
34725 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
34726 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
34727 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
34728 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34729 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34730 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34731 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34732 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34733 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34734 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34735 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34736 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34737 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34738 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME => {
34739 Some(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID)
34740 }
34741 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME => {
34742 Some(CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID)
34743 }
34744 CUBEPILOT_RAW_RC_DATA::NAME => Some(CUBEPILOT_RAW_RC_DATA::ID),
34745 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34746 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34747 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34748 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34749 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34750 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34751 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34752 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34753 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
34754 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
34755 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
34756 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
34757 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
34758 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
34759 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
34760 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
34761 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
34762 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
34763 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
34764 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
34765 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
34766 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
34767 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
34768 }
34769 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
34770 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
34771 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
34772 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
34773 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
34774 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
34775 }
34776 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
34777 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
34778 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
34779 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
34780 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
34781 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
34782 }
34783 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
34784 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
34785 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
34786 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
34787 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
34788 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
34789 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
34790 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
34791 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
34792 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
34793 HERELINK_TELEM_DATA::NAME => Some(HERELINK_TELEM_DATA::ID),
34794 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME => {
34795 Some(HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID)
34796 }
34797 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
34798 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
34799 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
34800 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
34801 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
34802 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
34803 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
34804 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
34805 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
34806 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
34807 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
34808 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
34809 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
34810 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
34811 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
34812 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
34813 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
34814 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
34815 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
34816 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
34817 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
34818 }
34819 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
34820 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
34821 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
34822 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
34823 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
34824 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
34825 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
34826 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
34827 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
34828 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
34829 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
34830 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
34831 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
34832 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
34833 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
34834 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
34835 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
34836 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
34837 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
34838 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
34839 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
34840 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
34841 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
34842 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
34843 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
34844 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
34845 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
34846 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
34847 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
34848 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
34849 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
34850 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
34851 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
34852 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
34853 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
34854 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
34855 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
34856 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
34857 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
34858 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
34859 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
34860 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
34861 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
34862 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
34863 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
34864 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
34865 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
34866 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
34867 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34868 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34869 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34870 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34871 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34872 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34873 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34874 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34875 PING_DATA::NAME => Some(PING_DATA::ID),
34876 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34877 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34878 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34879 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34880 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34881 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34882 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34883 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34884 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34885 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34886 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34887 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34888 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34889 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34890 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34891 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34892 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34893 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34894 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34895 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34896 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34897 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34898 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34899 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34900 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34901 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34902 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34903 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34904 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34905 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34906 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34907 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34908 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34909 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34910 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34911 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34912 }
34913 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34914 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34915 }
34916 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34917 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34918 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34919 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34920 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34921 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34922 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34923 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34924 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34925 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34926 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34927 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34928 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34929 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34930 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34931 }
34932 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34933 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34934 }
34935 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34936 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34937 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34938 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34939 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34940 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34941 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34942 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34943 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34944 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34945 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34946 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34947 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34948 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34949 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34950 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34951 _ => None,
34952 }
34953 }
34954 fn default_message_from_id(id: u32) -> Option<Self> {
34955 match id {
34956 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34957 ACTUATOR_CONTROL_TARGET_DATA::default(),
34958 )),
34959 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34960 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34961 )),
34962 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34963 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34964 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34965 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34966 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34967 ATTITUDE_QUATERNION_DATA::default(),
34968 )),
34969 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34970 ATTITUDE_QUATERNION_COV_DATA::default(),
34971 )),
34972 ATTITUDE_TARGET_DATA::ID => {
34973 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34974 }
34975 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34976 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34977 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34978 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34979 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34980 ))
34981 }
34982 AUTOPILOT_VERSION_DATA::ID => {
34983 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34984 }
34985 AVAILABLE_MODES_DATA::ID => {
34986 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34987 }
34988 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34989 AVAILABLE_MODES_MONITOR_DATA::default(),
34990 )),
34991 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34992 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34993 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34994 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34995 CAMERA_CAPTURE_STATUS_DATA::default(),
34996 )),
34997 CAMERA_FOV_STATUS_DATA::ID => {
34998 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34999 }
35000 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35001 CAMERA_IMAGE_CAPTURED_DATA::default(),
35002 )),
35003 CAMERA_INFORMATION_DATA::ID => {
35004 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
35005 }
35006 CAMERA_SETTINGS_DATA::ID => {
35007 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
35008 }
35009 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35010 CAMERA_THERMAL_RANGE_DATA::default(),
35011 )),
35012 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35013 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
35014 )),
35015 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35016 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
35017 )),
35018 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
35019 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
35020 CAN_FILTER_MODIFY_DATA::ID => {
35021 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
35022 }
35023 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
35024 CELLULAR_CONFIG_DATA::ID => {
35025 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
35026 }
35027 CELLULAR_STATUS_DATA::ID => {
35028 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
35029 }
35030 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35031 CHANGE_OPERATOR_CONTROL_DATA::default(),
35032 )),
35033 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35034 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
35035 )),
35036 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
35037 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
35038 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
35039 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
35040 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
35041 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35042 COMPONENT_INFORMATION_DATA::default(),
35043 )),
35044 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35045 COMPONENT_INFORMATION_BASIC_DATA::default(),
35046 )),
35047 COMPONENT_METADATA_DATA::ID => {
35048 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
35049 }
35050 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35051 CONTROL_SYSTEM_STATE_DATA::default(),
35052 )),
35053 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
35054 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::default(),
35055 )),
35056 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
35057 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
35058 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::default(),
35059 ))
35060 }
35061 CUBEPILOT_RAW_RC_DATA::ID => {
35062 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::default()))
35063 }
35064 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35065 CURRENT_EVENT_SEQUENCE_DATA::default(),
35066 )),
35067 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
35068 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
35069 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35070 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
35071 )),
35072 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
35073 DEBUG_FLOAT_ARRAY_DATA::ID => {
35074 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
35075 }
35076 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
35077 DISTANCE_SENSOR_DATA::ID => {
35078 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
35079 }
35080 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
35081 ENCAPSULATED_DATA_DATA::ID => {
35082 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
35083 }
35084 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
35085 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
35086 ESTIMATOR_STATUS_DATA::ID => {
35087 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
35088 }
35089 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
35090 EXTENDED_SYS_STATE_DATA::ID => {
35091 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
35092 }
35093 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
35094 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35095 FILE_TRANSFER_PROTOCOL_DATA::default(),
35096 )),
35097 FLIGHT_INFORMATION_DATA::ID => {
35098 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
35099 }
35100 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
35101 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
35102 GENERATOR_STATUS_DATA::ID => {
35103 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
35104 }
35105 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35106 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
35107 )),
35108 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35109 GIMBAL_DEVICE_INFORMATION_DATA::default(),
35110 )),
35111 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35112 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
35113 )),
35114 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35115 GIMBAL_MANAGER_INFORMATION_DATA::default(),
35116 )),
35117 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35118 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
35119 )),
35120 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35121 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35122 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
35123 ))
35124 }
35125 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35126 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
35127 )),
35128 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35129 GIMBAL_MANAGER_STATUS_DATA::default(),
35130 )),
35131 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35132 GLOBAL_POSITION_INT_DATA::default(),
35133 )),
35134 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35135 GLOBAL_POSITION_INT_COV_DATA::default(),
35136 )),
35137 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35138 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35139 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
35140 ))
35141 }
35142 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
35143 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
35144 GPS_GLOBAL_ORIGIN_DATA::ID => {
35145 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
35146 }
35147 GPS_INJECT_DATA_DATA::ID => {
35148 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
35149 }
35150 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
35151 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
35152 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
35153 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
35154 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
35155 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
35156 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::default())),
35157 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
35158 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
35159 HERELINK_VIDEO_STREAM_INFORMATION_DATA::default(),
35160 ))
35161 }
35162 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
35163 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
35164 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
35165 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35166 HIL_ACTUATOR_CONTROLS_DATA::default(),
35167 )),
35168 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
35169 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
35170 HIL_OPTICAL_FLOW_DATA::ID => {
35171 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
35172 }
35173 HIL_RC_INPUTS_RAW_DATA::ID => {
35174 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
35175 }
35176 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
35177 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
35178 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35179 HIL_STATE_QUATERNION_DATA::default(),
35180 )),
35181 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
35182 HYGROMETER_SENSOR_DATA::ID => {
35183 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
35184 }
35185 ILLUMINATOR_STATUS_DATA::ID => {
35186 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
35187 }
35188 ISBD_LINK_STATUS_DATA::ID => {
35189 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
35190 }
35191 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
35192 LINK_NODE_STATUS_DATA::ID => {
35193 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
35194 }
35195 LOCAL_POSITION_NED_DATA::ID => {
35196 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
35197 }
35198 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35199 LOCAL_POSITION_NED_COV_DATA::default(),
35200 )),
35201 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35202 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35203 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
35204 ))
35205 }
35206 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
35207 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
35208 LOGGING_DATA_ACKED_DATA::ID => {
35209 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
35210 }
35211 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
35212 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
35213 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
35214 LOG_REQUEST_DATA_DATA::ID => {
35215 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
35216 }
35217 LOG_REQUEST_END_DATA::ID => {
35218 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
35219 }
35220 LOG_REQUEST_LIST_DATA::ID => {
35221 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
35222 }
35223 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
35224 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
35225 MANUAL_SETPOINT_DATA::ID => {
35226 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
35227 }
35228 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
35229 MESSAGE_INTERVAL_DATA::ID => {
35230 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
35231 }
35232 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
35233 MISSION_CLEAR_ALL_DATA::ID => {
35234 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
35235 }
35236 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
35237 MISSION_CURRENT_DATA::ID => {
35238 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
35239 }
35240 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
35241 MISSION_ITEM_INT_DATA::ID => {
35242 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
35243 }
35244 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35245 MISSION_ITEM_REACHED_DATA::default(),
35246 )),
35247 MISSION_REQUEST_DATA::ID => {
35248 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
35249 }
35250 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35251 MISSION_REQUEST_INT_DATA::default(),
35252 )),
35253 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35254 MISSION_REQUEST_LIST_DATA::default(),
35255 )),
35256 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35257 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
35258 )),
35259 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35260 MISSION_SET_CURRENT_DATA::default(),
35261 )),
35262 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35263 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
35264 )),
35265 MOUNT_ORIENTATION_DATA::ID => {
35266 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
35267 }
35268 NAMED_VALUE_FLOAT_DATA::ID => {
35269 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
35270 }
35271 NAMED_VALUE_INT_DATA::ID => {
35272 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
35273 }
35274 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35275 NAV_CONTROLLER_OUTPUT_DATA::default(),
35276 )),
35277 OBSTACLE_DISTANCE_DATA::ID => {
35278 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
35279 }
35280 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
35281 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35282 ONBOARD_COMPUTER_STATUS_DATA::default(),
35283 )),
35284 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35285 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
35286 )),
35287 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35288 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
35289 )),
35290 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35291 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
35292 )),
35293 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35294 OPEN_DRONE_ID_LOCATION_DATA::default(),
35295 )),
35296 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35297 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
35298 )),
35299 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35300 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
35301 )),
35302 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35303 OPEN_DRONE_ID_SELF_ID_DATA::default(),
35304 )),
35305 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35306 OPEN_DRONE_ID_SYSTEM_DATA::default(),
35307 )),
35308 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35309 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
35310 )),
35311 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
35312 OPTICAL_FLOW_RAD_DATA::ID => {
35313 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
35314 }
35315 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35316 ORBIT_EXECUTION_STATUS_DATA::default(),
35317 )),
35318 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
35319 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35320 PARAM_EXT_REQUEST_LIST_DATA::default(),
35321 )),
35322 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35323 PARAM_EXT_REQUEST_READ_DATA::default(),
35324 )),
35325 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
35326 PARAM_EXT_VALUE_DATA::ID => {
35327 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
35328 }
35329 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
35330 PARAM_REQUEST_LIST_DATA::ID => {
35331 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
35332 }
35333 PARAM_REQUEST_READ_DATA::ID => {
35334 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
35335 }
35336 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
35337 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
35338 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
35339 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
35340 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
35341 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35342 POSITION_TARGET_GLOBAL_INT_DATA::default(),
35343 )),
35344 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35345 POSITION_TARGET_LOCAL_NED_DATA::default(),
35346 )),
35347 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
35348 PROTOCOL_VERSION_DATA::ID => {
35349 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
35350 }
35351 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
35352 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
35353 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
35354 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
35355 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
35356 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35357 RC_CHANNELS_OVERRIDE_DATA::default(),
35358 )),
35359 RC_CHANNELS_RAW_DATA::ID => {
35360 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
35361 }
35362 RC_CHANNELS_SCALED_DATA::ID => {
35363 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
35364 }
35365 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35366 REQUEST_DATA_STREAM_DATA::default(),
35367 )),
35368 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
35369 RESOURCE_REQUEST_DATA::ID => {
35370 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
35371 }
35372 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35373 RESPONSE_EVENT_ERROR_DATA::default(),
35374 )),
35375 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35376 SAFETY_ALLOWED_AREA_DATA::default(),
35377 )),
35378 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35379 SAFETY_SET_ALLOWED_AREA_DATA::default(),
35380 )),
35381 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
35382 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
35383 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
35384 SCALED_PRESSURE_DATA::ID => {
35385 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
35386 }
35387 SCALED_PRESSURE2_DATA::ID => {
35388 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
35389 }
35390 SCALED_PRESSURE3_DATA::ID => {
35391 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
35392 }
35393 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
35394 SERVO_OUTPUT_RAW_DATA::ID => {
35395 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
35396 }
35397 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
35398 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35399 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
35400 )),
35401 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35402 SET_ATTITUDE_TARGET_DATA::default(),
35403 )),
35404 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35405 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
35406 )),
35407 SET_HOME_POSITION_DATA::ID => {
35408 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
35409 }
35410 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
35411 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35412 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
35413 )),
35414 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35415 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
35416 )),
35417 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
35418 SMART_BATTERY_INFO_DATA::ID => {
35419 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
35420 }
35421 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
35422 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35423 STORAGE_INFORMATION_DATA::default(),
35424 )),
35425 SUPPORTED_TUNES_DATA::ID => {
35426 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
35427 }
35428 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
35429 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
35430 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
35431 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
35432 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
35433 TERRAIN_REQUEST_DATA::ID => {
35434 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
35435 }
35436 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
35437 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35438 TIME_ESTIMATE_TO_TARGET_DATA::default(),
35439 )),
35440 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35441 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35442 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
35443 ))
35444 }
35445 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35446 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35447 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35448 ))
35449 }
35450 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35451 UAVCAN_NODE_INFO_DATA::ID => {
35452 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
35453 }
35454 UAVCAN_NODE_STATUS_DATA::ID => {
35455 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35456 }
35457 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35458 UTM_GLOBAL_POSITION_DATA::default(),
35459 )),
35460 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35461 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
35462 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35463 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35464 VICON_POSITION_ESTIMATE_DATA::default(),
35465 )),
35466 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35467 VIDEO_STREAM_INFORMATION_DATA::default(),
35468 )),
35469 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35470 VIDEO_STREAM_STATUS_DATA::default(),
35471 )),
35472 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35473 VISION_POSITION_ESTIMATE_DATA::default(),
35474 )),
35475 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35476 VISION_SPEED_ESTIMATE_DATA::default(),
35477 )),
35478 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
35479 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
35480 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
35481 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
35482 _ => None,
35483 }
35484 }
35485 #[cfg(feature = "arbitrary")]
35486 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35487 match id {
35488 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35489 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35490 )),
35491 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35492 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35493 )),
35494 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35495 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35496 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35497 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35498 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35499 ATTITUDE_QUATERNION_DATA::random(rng),
35500 )),
35501 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35502 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35503 )),
35504 ATTITUDE_TARGET_DATA::ID => {
35505 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35506 }
35507 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35508 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35509 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35510 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35511 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35512 ))
35513 }
35514 AUTOPILOT_VERSION_DATA::ID => {
35515 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35516 }
35517 AVAILABLE_MODES_DATA::ID => {
35518 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35519 }
35520 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35521 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35522 )),
35523 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35524 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35525 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35526 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35527 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35528 )),
35529 CAMERA_FOV_STATUS_DATA::ID => {
35530 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35531 }
35532 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35533 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35534 )),
35535 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35536 CAMERA_INFORMATION_DATA::random(rng),
35537 )),
35538 CAMERA_SETTINGS_DATA::ID => {
35539 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35540 }
35541 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35542 CAMERA_THERMAL_RANGE_DATA::random(rng),
35543 )),
35544 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35545 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35546 )),
35547 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35548 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35549 )),
35550 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35551 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35552 CAN_FILTER_MODIFY_DATA::ID => {
35553 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35554 }
35555 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35556 CELLULAR_CONFIG_DATA::ID => {
35557 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35558 }
35559 CELLULAR_STATUS_DATA::ID => {
35560 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35561 }
35562 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35563 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35564 )),
35565 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35566 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35567 )),
35568 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35569 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35570 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35571 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35572 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35573 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35574 COMPONENT_INFORMATION_DATA::random(rng),
35575 )),
35576 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35577 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35578 )),
35579 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35580 COMPONENT_METADATA_DATA::random(rng),
35581 )),
35582 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35583 CONTROL_SYSTEM_STATE_DATA::random(rng),
35584 )),
35585 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
35586 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::random(rng),
35587 )),
35588 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
35589 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
35590 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::random(rng),
35591 ))
35592 }
35593 CUBEPILOT_RAW_RC_DATA::ID => {
35594 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::random(rng)))
35595 }
35596 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35597 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35598 )),
35599 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35600 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35601 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35602 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35603 )),
35604 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35605 DEBUG_FLOAT_ARRAY_DATA::ID => {
35606 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35607 }
35608 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35609 DISTANCE_SENSOR_DATA::ID => {
35610 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35611 }
35612 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35613 ENCAPSULATED_DATA_DATA::ID => {
35614 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35615 }
35616 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35617 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35618 ESTIMATOR_STATUS_DATA::ID => {
35619 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35620 }
35621 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35622 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35623 EXTENDED_SYS_STATE_DATA::random(rng),
35624 )),
35625 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35626 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35627 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35628 )),
35629 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35630 FLIGHT_INFORMATION_DATA::random(rng),
35631 )),
35632 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35633 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35634 GENERATOR_STATUS_DATA::ID => {
35635 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35636 }
35637 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35638 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35639 )),
35640 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35641 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35642 )),
35643 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35644 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35645 )),
35646 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35647 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35648 )),
35649 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35650 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35651 )),
35652 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35653 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35654 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35655 ))
35656 }
35657 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35658 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35659 )),
35660 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35661 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35662 )),
35663 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35664 GLOBAL_POSITION_INT_DATA::random(rng),
35665 )),
35666 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35667 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35668 )),
35669 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35670 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35671 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35672 ))
35673 }
35674 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35675 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35676 GPS_GLOBAL_ORIGIN_DATA::ID => {
35677 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35678 }
35679 GPS_INJECT_DATA_DATA::ID => {
35680 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35681 }
35682 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35683 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35684 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35685 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35686 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35687 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35688 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::random(rng))),
35689 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
35690 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
35691 HERELINK_VIDEO_STREAM_INFORMATION_DATA::random(rng),
35692 ))
35693 }
35694 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35695 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35696 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35697 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35698 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35699 )),
35700 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35701 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35702 HIL_OPTICAL_FLOW_DATA::ID => {
35703 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35704 }
35705 HIL_RC_INPUTS_RAW_DATA::ID => {
35706 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35707 }
35708 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35709 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35710 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35711 HIL_STATE_QUATERNION_DATA::random(rng),
35712 )),
35713 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35714 HYGROMETER_SENSOR_DATA::ID => {
35715 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35716 }
35717 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35718 ILLUMINATOR_STATUS_DATA::random(rng),
35719 )),
35720 ISBD_LINK_STATUS_DATA::ID => {
35721 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35722 }
35723 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35724 LINK_NODE_STATUS_DATA::ID => {
35725 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35726 }
35727 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35728 LOCAL_POSITION_NED_DATA::random(rng),
35729 )),
35730 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35731 LOCAL_POSITION_NED_COV_DATA::random(rng),
35732 )),
35733 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35734 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35735 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35736 ))
35737 }
35738 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35739 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35740 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35741 LOGGING_DATA_ACKED_DATA::random(rng),
35742 )),
35743 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35744 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35745 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35746 LOG_REQUEST_DATA_DATA::ID => {
35747 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35748 }
35749 LOG_REQUEST_END_DATA::ID => {
35750 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35751 }
35752 LOG_REQUEST_LIST_DATA::ID => {
35753 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35754 }
35755 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35756 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35757 MANUAL_SETPOINT_DATA::ID => {
35758 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35759 }
35760 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35761 MESSAGE_INTERVAL_DATA::ID => {
35762 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35763 }
35764 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35765 MISSION_CLEAR_ALL_DATA::ID => {
35766 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35767 }
35768 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35769 MISSION_CURRENT_DATA::ID => {
35770 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35771 }
35772 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35773 MISSION_ITEM_INT_DATA::ID => {
35774 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35775 }
35776 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35777 MISSION_ITEM_REACHED_DATA::random(rng),
35778 )),
35779 MISSION_REQUEST_DATA::ID => {
35780 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
35781 }
35782 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35783 MISSION_REQUEST_INT_DATA::random(rng),
35784 )),
35785 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35786 MISSION_REQUEST_LIST_DATA::random(rng),
35787 )),
35788 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35789 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
35790 )),
35791 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35792 MISSION_SET_CURRENT_DATA::random(rng),
35793 )),
35794 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35795 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
35796 )),
35797 MOUNT_ORIENTATION_DATA::ID => {
35798 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
35799 }
35800 NAMED_VALUE_FLOAT_DATA::ID => {
35801 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
35802 }
35803 NAMED_VALUE_INT_DATA::ID => {
35804 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
35805 }
35806 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35807 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
35808 )),
35809 OBSTACLE_DISTANCE_DATA::ID => {
35810 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
35811 }
35812 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
35813 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35814 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
35815 )),
35816 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35817 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
35818 )),
35819 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35820 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
35821 )),
35822 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35823 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
35824 )),
35825 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35826 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
35827 )),
35828 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35829 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
35830 )),
35831 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35832 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
35833 )),
35834 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35835 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
35836 )),
35837 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35838 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
35839 )),
35840 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35841 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
35842 )),
35843 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
35844 OPTICAL_FLOW_RAD_DATA::ID => {
35845 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
35846 }
35847 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35848 ORBIT_EXECUTION_STATUS_DATA::random(rng),
35849 )),
35850 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
35851 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35852 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
35853 )),
35854 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35855 PARAM_EXT_REQUEST_READ_DATA::random(rng),
35856 )),
35857 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
35858 PARAM_EXT_VALUE_DATA::ID => {
35859 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
35860 }
35861 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
35862 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
35863 PARAM_REQUEST_LIST_DATA::random(rng),
35864 )),
35865 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
35866 PARAM_REQUEST_READ_DATA::random(rng),
35867 )),
35868 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
35869 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
35870 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
35871 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
35872 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
35873 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35874 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35875 )),
35876 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35877 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35878 )),
35879 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
35880 PROTOCOL_VERSION_DATA::ID => {
35881 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35882 }
35883 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35884 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35885 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35886 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35887 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35888 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35889 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35890 )),
35891 RC_CHANNELS_RAW_DATA::ID => {
35892 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35893 }
35894 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35895 RC_CHANNELS_SCALED_DATA::random(rng),
35896 )),
35897 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35898 REQUEST_DATA_STREAM_DATA::random(rng),
35899 )),
35900 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35901 RESOURCE_REQUEST_DATA::ID => {
35902 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35903 }
35904 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35905 RESPONSE_EVENT_ERROR_DATA::random(rng),
35906 )),
35907 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35908 SAFETY_ALLOWED_AREA_DATA::random(rng),
35909 )),
35910 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35911 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35912 )),
35913 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35914 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35915 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35916 SCALED_PRESSURE_DATA::ID => {
35917 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35918 }
35919 SCALED_PRESSURE2_DATA::ID => {
35920 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35921 }
35922 SCALED_PRESSURE3_DATA::ID => {
35923 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35924 }
35925 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35926 SERVO_OUTPUT_RAW_DATA::ID => {
35927 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35928 }
35929 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35930 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35931 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35932 )),
35933 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35934 SET_ATTITUDE_TARGET_DATA::random(rng),
35935 )),
35936 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35937 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35938 )),
35939 SET_HOME_POSITION_DATA::ID => {
35940 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35941 }
35942 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35943 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35944 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35945 )),
35946 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35947 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35948 )),
35949 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35950 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35951 SMART_BATTERY_INFO_DATA::random(rng),
35952 )),
35953 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35954 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35955 STORAGE_INFORMATION_DATA::random(rng),
35956 )),
35957 SUPPORTED_TUNES_DATA::ID => {
35958 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35959 }
35960 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35961 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35962 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35963 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35964 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35965 TERRAIN_REQUEST_DATA::ID => {
35966 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35967 }
35968 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35969 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35970 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35971 )),
35972 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35973 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35974 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35975 ))
35976 }
35977 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35978 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35979 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35980 ))
35981 }
35982 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35983 UAVCAN_NODE_INFO_DATA::ID => {
35984 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35985 }
35986 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35987 UAVCAN_NODE_STATUS_DATA::random(rng),
35988 )),
35989 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35990 UTM_GLOBAL_POSITION_DATA::random(rng),
35991 )),
35992 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35993 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35994 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35995 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35996 VICON_POSITION_ESTIMATE_DATA::random(rng),
35997 )),
35998 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35999 VIDEO_STREAM_INFORMATION_DATA::random(rng),
36000 )),
36001 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
36002 VIDEO_STREAM_STATUS_DATA::random(rng),
36003 )),
36004 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
36005 VISION_POSITION_ESTIMATE_DATA::random(rng),
36006 )),
36007 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
36008 VISION_SPEED_ESTIMATE_DATA::random(rng),
36009 )),
36010 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
36011 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
36012 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
36013 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
36014 _ => None,
36015 }
36016 }
36017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36018 match self {
36019 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36020 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
36021 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
36022 Self::AIS_VESSEL(body) => body.ser(version, bytes),
36023 Self::ALTITUDE(body) => body.ser(version, bytes),
36024 Self::ATTITUDE(body) => body.ser(version, bytes),
36025 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
36026 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
36027 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
36028 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
36029 Self::AUTH_KEY(body) => body.ser(version, bytes),
36030 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
36031 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
36032 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
36033 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
36034 Self::BATTERY_INFO(body) => body.ser(version, bytes),
36035 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
36036 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
36037 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
36038 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
36039 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
36040 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
36041 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
36042 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
36043 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
36044 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
36045 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
36046 Self::CANFD_FRAME(body) => body.ser(version, bytes),
36047 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
36048 Self::CAN_FRAME(body) => body.ser(version, bytes),
36049 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
36050 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
36051 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
36052 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
36053 Self::COLLISION(body) => body.ser(version, bytes),
36054 Self::COMMAND_ACK(body) => body.ser(version, bytes),
36055 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
36056 Self::COMMAND_INT(body) => body.ser(version, bytes),
36057 Self::COMMAND_LONG(body) => body.ser(version, bytes),
36058 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
36059 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
36060 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
36061 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
36062 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(body) => body.ser(version, bytes),
36063 Self::CUBEPILOT_FIRMWARE_UPDATE_START(body) => body.ser(version, bytes),
36064 Self::CUBEPILOT_RAW_RC(body) => body.ser(version, bytes),
36065 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
36066 Self::CURRENT_MODE(body) => body.ser(version, bytes),
36067 Self::DATA_STREAM(body) => body.ser(version, bytes),
36068 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
36069 Self::DEBUG(body) => body.ser(version, bytes),
36070 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
36071 Self::DEBUG_VECT(body) => body.ser(version, bytes),
36072 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
36073 Self::EFI_STATUS(body) => body.ser(version, bytes),
36074 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
36075 Self::ESC_INFO(body) => body.ser(version, bytes),
36076 Self::ESC_STATUS(body) => body.ser(version, bytes),
36077 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
36078 Self::EVENT(body) => body.ser(version, bytes),
36079 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
36080 Self::FENCE_STATUS(body) => body.ser(version, bytes),
36081 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
36082 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
36083 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
36084 Self::FUEL_STATUS(body) => body.ser(version, bytes),
36085 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
36086 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
36087 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
36088 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
36089 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
36090 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
36091 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
36092 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
36093 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
36094 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
36095 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
36096 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36097 Self::GPS2_RAW(body) => body.ser(version, bytes),
36098 Self::GPS2_RTK(body) => body.ser(version, bytes),
36099 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36100 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
36101 Self::GPS_INPUT(body) => body.ser(version, bytes),
36102 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
36103 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
36104 Self::GPS_RTK(body) => body.ser(version, bytes),
36105 Self::GPS_STATUS(body) => body.ser(version, bytes),
36106 Self::HEARTBEAT(body) => body.ser(version, bytes),
36107 Self::HERELINK_TELEM(body) => body.ser(version, bytes),
36108 Self::HERELINK_VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36109 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
36110 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
36111 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
36112 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
36113 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
36114 Self::HIL_GPS(body) => body.ser(version, bytes),
36115 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
36116 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
36117 Self::HIL_SENSOR(body) => body.ser(version, bytes),
36118 Self::HIL_STATE(body) => body.ser(version, bytes),
36119 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
36120 Self::HOME_POSITION(body) => body.ser(version, bytes),
36121 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
36122 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
36123 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
36124 Self::LANDING_TARGET(body) => body.ser(version, bytes),
36125 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
36126 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
36127 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
36128 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
36129 Self::LOGGING_ACK(body) => body.ser(version, bytes),
36130 Self::LOGGING_DATA(body) => body.ser(version, bytes),
36131 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
36132 Self::LOG_DATA(body) => body.ser(version, bytes),
36133 Self::LOG_ENTRY(body) => body.ser(version, bytes),
36134 Self::LOG_ERASE(body) => body.ser(version, bytes),
36135 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
36136 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
36137 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
36138 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
36139 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
36140 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
36141 Self::MEMORY_VECT(body) => body.ser(version, bytes),
36142 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
36143 Self::MISSION_ACK(body) => body.ser(version, bytes),
36144 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
36145 Self::MISSION_COUNT(body) => body.ser(version, bytes),
36146 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
36147 Self::MISSION_ITEM(body) => body.ser(version, bytes),
36148 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
36149 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
36150 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
36151 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
36152 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
36153 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
36154 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
36155 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
36156 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
36157 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
36158 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
36159 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
36160 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
36161 Self::ODOMETRY(body) => body.ser(version, bytes),
36162 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
36163 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
36164 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
36165 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
36166 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
36167 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
36168 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
36169 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
36170 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
36171 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
36172 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
36173 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
36174 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
36175 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
36176 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
36177 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
36178 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
36179 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
36180 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
36181 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
36182 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
36183 Self::PARAM_SET(body) => body.ser(version, bytes),
36184 Self::PARAM_VALUE(body) => body.ser(version, bytes),
36185 Self::PING(body) => body.ser(version, bytes),
36186 Self::PLAY_TUNE(body) => body.ser(version, bytes),
36187 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
36188 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36189 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36190 Self::POWER_STATUS(body) => body.ser(version, bytes),
36191 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
36192 Self::RADIO_STATUS(body) => body.ser(version, bytes),
36193 Self::RAW_IMU(body) => body.ser(version, bytes),
36194 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
36195 Self::RAW_RPM(body) => body.ser(version, bytes),
36196 Self::RC_CHANNELS(body) => body.ser(version, bytes),
36197 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
36198 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
36199 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
36200 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
36201 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
36202 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
36203 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
36204 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
36205 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
36206 Self::SCALED_IMU(body) => body.ser(version, bytes),
36207 Self::SCALED_IMU2(body) => body.ser(version, bytes),
36208 Self::SCALED_IMU3(body) => body.ser(version, bytes),
36209 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
36210 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
36211 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
36212 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
36213 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
36214 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
36215 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36216 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
36217 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36218 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
36219 Self::SET_MODE(body) => body.ser(version, bytes),
36220 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36221 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36222 Self::SIM_STATE(body) => body.ser(version, bytes),
36223 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
36224 Self::STATUSTEXT(body) => body.ser(version, bytes),
36225 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
36226 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
36227 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
36228 Self::SYS_STATUS(body) => body.ser(version, bytes),
36229 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
36230 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
36231 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
36232 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
36233 Self::TIMESYNC(body) => body.ser(version, bytes),
36234 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
36235 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
36236 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
36237 Self::TUNNEL(body) => body.ser(version, bytes),
36238 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
36239 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
36240 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
36241 Self::V2_EXTENSION(body) => body.ser(version, bytes),
36242 Self::VFR_HUD(body) => body.ser(version, bytes),
36243 Self::VIBRATION(body) => body.ser(version, bytes),
36244 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36245 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36246 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
36247 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36248 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
36249 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
36250 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
36251 Self::WINCH_STATUS(body) => body.ser(version, bytes),
36252 Self::WIND_COV(body) => body.ser(version, bytes),
36253 }
36254 }
36255 fn extra_crc(id: u32) -> u8 {
36256 match id {
36257 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36258 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
36259 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
36260 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
36261 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
36262 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
36263 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
36264 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
36265 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
36266 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
36267 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
36268 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36269 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
36270 }
36271 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
36272 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
36273 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
36274 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
36275 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
36276 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
36277 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
36278 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
36279 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
36280 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
36281 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
36282 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
36283 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
36284 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
36285 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
36286 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
36287 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
36288 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
36289 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
36290 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
36291 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
36292 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
36293 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
36294 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
36295 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
36296 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
36297 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
36298 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
36299 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
36300 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
36301 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
36302 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
36303 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::EXTRA_CRC
36304 }
36305 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
36306 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::EXTRA_CRC
36307 }
36308 CUBEPILOT_RAW_RC_DATA::ID => CUBEPILOT_RAW_RC_DATA::EXTRA_CRC,
36309 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
36310 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
36311 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
36312 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
36313 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
36314 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
36315 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
36316 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
36317 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
36318 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
36319 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
36320 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
36321 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
36322 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
36323 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
36324 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
36325 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
36326 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
36327 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
36328 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
36329 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
36330 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
36331 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
36332 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
36333 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
36334 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
36335 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36336 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
36337 }
36338 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
36339 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
36340 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
36341 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
36342 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36343 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
36344 }
36345 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
36346 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
36347 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36348 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
36349 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
36350 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
36351 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
36352 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
36353 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
36354 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
36355 HERELINK_TELEM_DATA::ID => HERELINK_TELEM_DATA::EXTRA_CRC,
36356 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
36357 HERELINK_VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC
36358 }
36359 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
36360 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
36361 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
36362 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
36363 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
36364 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
36365 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
36366 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
36367 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
36368 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
36369 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
36370 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
36371 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
36372 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
36373 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
36374 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
36375 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
36376 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
36377 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
36378 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36379 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
36380 }
36381 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
36382 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
36383 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
36384 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
36385 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
36386 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
36387 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
36388 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
36389 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
36390 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
36391 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
36392 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
36393 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
36394 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
36395 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
36396 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
36397 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
36398 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
36399 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
36400 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
36401 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
36402 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
36403 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
36404 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
36405 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
36406 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
36407 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
36408 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
36409 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
36410 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
36411 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
36412 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
36413 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
36414 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
36415 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
36416 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
36417 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
36418 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
36419 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
36420 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
36421 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
36422 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
36423 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
36424 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
36425 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
36426 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
36427 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
36428 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
36429 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
36430 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
36431 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
36432 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
36433 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
36434 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
36435 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
36436 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
36437 PING_DATA::ID => PING_DATA::EXTRA_CRC,
36438 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
36439 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
36440 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
36441 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36442 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
36443 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
36444 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
36445 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
36446 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
36447 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
36448 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
36449 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
36450 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
36451 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
36452 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
36453 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
36454 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
36455 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
36456 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36457 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36458 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36459 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36460 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36461 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36462 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36463 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36464 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36465 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36466 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36467 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36468 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36469 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36470 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36471 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36472 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36473 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36474 }
36475 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36476 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36477 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36478 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36479 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36480 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36481 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36482 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36483 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36484 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36485 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36486 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36487 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36488 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36489 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36490 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36491 }
36492 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36493 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36494 }
36495 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36496 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36497 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36498 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36499 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36500 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36501 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36502 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36503 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36504 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36505 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36506 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36507 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36508 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36509 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36510 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36511 _ => 0,
36512 }
36513 }
36514 fn target_system_id(&self) -> Option<u8> {
36515 match self {
36516 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36517 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36518 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36519 Self::CAN_FRAME(inner) => Some(inner.target_system),
36520 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36521 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36522 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36523 Self::COMMAND_INT(inner) => Some(inner.target_system),
36524 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36525 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_system),
36526 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_system),
36527 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36528 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36529 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36530 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36531 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36532 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36533 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36534 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36535 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36536 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36537 Self::LOG_ERASE(inner) => Some(inner.target_system),
36538 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36539 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36540 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36541 Self::MISSION_ACK(inner) => Some(inner.target_system),
36542 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36543 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36544 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36545 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36546 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36547 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36548 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36549 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36550 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36551 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36552 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36553 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36554 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36555 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36556 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36557 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36558 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36559 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36560 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36561 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36562 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36563 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36564 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36565 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36566 Self::PARAM_SET(inner) => Some(inner.target_system),
36567 Self::PING(inner) => Some(inner.target_system),
36568 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36569 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36570 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36571 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36572 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36573 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36574 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36575 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36576 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36577 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36578 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36579 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36580 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36581 Self::SET_MODE(inner) => Some(inner.target_system),
36582 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36583 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36584 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36585 Self::TIMESYNC(inner) => Some(inner.target_system),
36586 Self::TUNNEL(inner) => Some(inner.target_system),
36587 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36588 _ => None,
36589 }
36590 }
36591 fn target_component_id(&self) -> Option<u8> {
36592 match self {
36593 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36594 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36595 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36596 Self::CAN_FRAME(inner) => Some(inner.target_component),
36597 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36598 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36599 Self::COMMAND_INT(inner) => Some(inner.target_component),
36600 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36601 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_component),
36602 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_component),
36603 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36604 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36605 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36606 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36607 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36608 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36609 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36610 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36611 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36612 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36613 Self::LOG_ERASE(inner) => Some(inner.target_component),
36614 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36615 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36616 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36617 Self::MISSION_ACK(inner) => Some(inner.target_component),
36618 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36619 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36620 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36621 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36622 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36623 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36624 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36625 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36626 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36627 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36628 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36629 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36630 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36631 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36632 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36633 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36634 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36635 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36636 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36637 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36638 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36639 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36640 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36641 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36642 Self::PARAM_SET(inner) => Some(inner.target_component),
36643 Self::PING(inner) => Some(inner.target_component),
36644 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36645 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36646 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36647 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36648 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36649 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36650 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36651 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36652 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36653 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36654 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36655 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36656 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36657 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36658 Self::TIMESYNC(inner) => Some(inner.target_component),
36659 Self::TUNNEL(inner) => Some(inner.target_component),
36660 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36661 _ => None,
36662 }
36663 }
36664}